Native built-in browser elements you can use today instead of ARIA or ROLE attributesArticle contains
  1. The first rule of ARIA
  2. Why move away from ARIA?
    1. Browser-engine privilege
    2. Less code, less maintenance
    3. Smaller payload, faster render
    4. Built-in resilience to future spec changes
    5. Mobile and voice-input compatibility
    6. Security and performance isolation
    7. Internationalisation for free
    8. Future-proofing for new input modalities
    9. Easier testing and audits
    10. Legal, procurement safety
  3. When ARIA is still justified
  4. Native HTML replacements for ARIA roles and attributes
  5. Conclusion
Text "Aria to semantic HTML" where "HTML" is on tiles.

Native built-in browser elements you can use today instead of ARIA or ROLE attributes

When building accessible web applications, developers have long relied on ARIA and role attributes to fill gaps in native HTML.

But today, many of those gaps are gone. Modern browsers support a wide range of semantic HTML elements and built-in behaviors that make ARIA redundant in most cases, often with better results and fewer bugs.

This shift towards native accessibility features means that developers can now create accessible web applications using built-in browser elements and attributes, rather than relying solely on ARIA and ROLE only.

We’ll explore the native built-in browser elements and attributes that you can use today to improve accessibility, and how they can replace or complement ARIA and ROLE attributes in your web development workflow. By leveraging these native features, you can simplify your code, improve maintainability, and create more accessible web applications for everyone.

Continue reading “Native built-in browser elements you can use today instead of ARIA or ROLE attributes”
Chrome DevTools XPath safety - escape the JavaScript literal not the XPathArticle contains
  1. When a simple XPath field becomes Remote Code Execution (RCE)
  2. Why document.evaluate itself is innocent
  3. The JavaScript meta-character trap
  4. Sanitizing XPath
  5. Integration recipes
  6. Solutions that fail security review
  7. Short security checklist
  8. Final words
A piece of code with the words "Security Alert" on it. Image by Elchinator from Pixabay.

Chrome DevTools XPath safety – escape the JavaScript literal not the XPath

XPath, or XML Path Language, is a query language designed to navigate through elements and attributes in an XML document. The document.evaluate() method in JavaScript allows developers to execute XPath expressions against an XML document, returning nodes or values based on the specified query. While this functionality is powerful, it also poses risks of injection attacks if user input is not properly handled.

Continue reading “Chrome DevTools XPath safety – escape the JavaScript literal not the XPath”
Make CSS blur stay within container boundariesArticle contains
  1. The problem with blur overflow
  2. Understanding the issue
  3. Solution to keep blur within container boundaries
    1. Step 1 - why the halo appears
    2. Step 2 - why transform: scale() is the cheapest margin
    3. Step 3 - why overflow: clip instead of hidden
    4. Optional speed boost: add will-change: transform to the pseudo-element
  4. Workable example - putting it together
Very blurred beach. Image by StockSnap from Pixabay.

Make CSS blur stay within container boundaries

CSS filter: blur() is a fantastic tool for adding visual interest and depth to your web designs. It creates a soft, out-of-focus effect that can be used in various ways, from creating frosted glass backgrounds to subtle focus indicators. However, by default, the blur effect can sometimes overflow the boundaries of the element it’s applied to, leading to unexpected visual results. This article will guide you through techniques to keep that blur effect neatly contained within its intended space.

Continue reading “Make CSS blur stay within container boundaries”
Accessibility automated website scans and how much can they catchArticle contains
  1. Introduction
  2. What percentage of accessibility issues can automated tools catch?
  3. What automated tools can catch
  4. Why manual testing is non-negotiable
  5. WCAG 2.2 quick-reference: which Success Criteria can be scripted, which can't, and why
Two chairs and multiple monitors opposite. One of them bears the words: "Digital Accessibility Audit in progress...". Image by Andy from Pixabay

Accessibility automated website scans and how much can they catch

Automated accessibility testing tools have gained traction due to their ability to quickly analyze web pages for compliance with accessibility standards, such as the Web Content Accessibility Guidelines (WCAG). These tools can scan a website’s code and identify potential issues, making them an attractive option for developers and organizations looking to improve accessibility.

Continue reading “Accessibility automated website scans and how much can they catch”
Formatting currency in Angular using Intl.NumberFormatArticle contains
  1. Understanding Intl.NumberFormat
    1. Key features of Intl.NumberFormat
  2. Implementing currency formatting in Angular
    1. Usage example
  3. Final words
Semantic HTML explainedArticle contains
  1. What is semantic in HTML?
  2. What is the difference between semantic HTML and traditional HTML?
    1. Traditional HTML
    2. Semantic HTML
  3. Key differences
  4. What is an example of a semantic code?
  5. Benefits of semantic HTML
  6. What is semantic HTML in accessibility?
    1. Meaningful structure for assistive technologies
    2. Improved content understanding
    3. Enhanced keyboard navigation
    4. Compatibility with ARIA attributes
  7. Does semantic HTML improve SEO?
    1. Better content structure
    2. Enhanced crawling and indexing
    3. Rich snippets and featured results
    4. Keyword context
  8. Semantic HTML enhances maintainability and code readability
  9. Web components
  10. Challenges and traps
  11. Considerations and best practices
    1. Structured data (JSON-LD)
    2. Using ARIA and role attributes
  12. Frequently asked questions
    1. Why should I use semantic HTML?
    2. Why should I worry about semantic HTML when I use structured data (JSON-LD)?
  13. Summary
Four tiles and on each of them letters: H, T, M, L. Above sentence: semantic. Image by Miguel Á. Padriñán from Pixabay

Semantic HTML explained

Semantic HTML. The term itself might sound technical and niche, but its impact on the web is anything but. It’s the foundation upon which accessible, maintainable, and search engine-friendly website content is built. Let’s dive into the core principles of semantic HTML, exploring its benefits, common pitfalls, and ultimately, why it’s a crucial skill for any web developer.

Continue reading “Semantic HTML explained”
JavaScript and wait until DOM element existsArticle contains
  1. Introduction
  2. How to wait until a DOM element exists before executing a JavaScript function?
  3. Solution and implementation
  4. Workable example
A keyboard placed on a white surface, accompanied by text that includes "JAVASCRIPT Wait for the DOM element."

JavaScript and wait until DOM element exists

To wait for an HTML element to exist in the DOM using JavaScript, we’ll use requestAnimationFrame to periodically check for the element’s existence, and combine it with Promise to achieve this without blocking the main thread.

This approach is performance-friendly because requestAnimationFrame allows the browser to optimize rendering and ensures that the checks occur at the right time in the rendering cycle.

Continue reading “JavaScript and wait until DOM element exists”
Auditing website using Chrome extensionArticle contains
  1. What are Chrome extensions?
  2. Why auditing website using Chrome extension?
  3. What are the advantages for Chrome extension?
    1. Enhancing productivity
    2. Customizing the browsing experience
    3. Improving communication and collaboration
    4. Enhancing security and privacy
    5. Seamless integration with web applications
    6. Opportunity for audits and recommendations
  4. How can web developers benefit from using Chrome extensions for audits?
    1. Comprehensive auditing tools
    2. Real-time feedback
    3. Streamlined workflow
    4. Enhanced collaboration
    5. Continuous improvement
  5. What are limitations for Chrome extension?
    1. Capabilities and behavior limitations
    2. Key technical limitations of Chrome extensions
    3. Policies and guidelines
  6. Single code, high portability
  7. Conclusion
Abstract circles. Image by Reto Scheiwiller from Pixabay.

Auditing website using Chrome extension

Website performance, SEO, and accessibility are crucial for online success. A comprehensive audit serves as a critical tool for identifying areas of improvement, enhancing user experience, and optimizing search engine performance. But conducting a thorough audit can seem daunting, especially for smaller businesses or individuals with limited budgets. Thankfully, a plethora of free Chrome extensions offer a convenient and accessible way to analyze your website and identify areas for improvement.

This review explores the capabilities and limitations of using such extensions for website auditing.

Continue reading “Auditing website using Chrome extension”
Escape HTML string tags in JavaScriptArticle contains
  1. Why escape HTML?
  2. What happens when HTML is not escaped?
  3. How does escaping HTML prevent XSS attacks?
  4. When to escape HTML?
  5. Best practices for secure HTML escaping
    1. Escape on output, not on input
    2. Use a trusted escaping mechanism
    3. Avoid manual replacement
    4. Test your escaping mechanism
    5. Consider Content Security Policy (CSP)
  6. How to escape an HTML string in JavaScript?
    1. Character replacement
    2. Tagged template literal function
  7. When to use the escapeHtml template literal function
  8. Comparison of the provided code examples
  9. In summary
Implement "Please wait" message while iframe is loading using JavaScriptArticle contains
  1. Easy steps to implement a Please Wait message
  2. The code usage example
  3. Understanding the code
  4. Workable example
  5. Tips for enhancements and important considerations
  6. Conclusion
Monitor, code on it and the open HTML tag iframe.

Implement “Please wait” message while iframe is loading using JavaScript

When embedding content using iframe (inline frame), users may experience delays while the iframe loads, especially if the content is from a slow server or a third-party site. During this period, users may perceive the application as unresponsive. To mitigate this issue, a Please wait message or an animated loading indicator can be displayed, depending on the design requirements.

Let’s explore the method to implement Please wait message for the iframe using TypeScript, a superset of JavaScript.

Continue reading “Implement “Please wait” message while iframe is loading using JavaScript”