For AI agents: the complete documentation index is available at https://nhanbe.id.vn/llms.txt, the full documentation bundle is available at https://nhanbe.id.vn/llms-full.txt, and this page is available as Markdown at https://nhanbe.id.vn/building-for-the-web/equalweb-intro.md.

EqualWeb Accessibility Overlay

Technical guide to integrating the EqualWeb accessibility widget: configuring window.interdeal, setting up Content Security Policy (CSP), optimizing Core Web Vitals, and evaluating overlay trade-offs.

EqualWeb Accessibility Overlay

EqualWeb is a client-side accessibility overlay widget that gives end users an on-page toolbar to customize visual presentation and injects runtime accessibility (a11y) adjustments targeting WCAG 2.1/2.2 AA, ADA Title III, and Section 508 requirements.

For engineering teams, it offers a fast drop-in third-party script integration that requires minimal changes to existing application code.

EqualWeb Accessibility Widget interface

Integration complexity: 1 / 10

How It Works

EqualWeb runs entirely in the browser at runtime:

  1. Loader script: A lightweight bootstrap script (~5 KB) loads asynchronously (async or defer) and reads configuration from the window.interdeal global object.
  2. DOM injection: The loader fetches the core bundle from the EqualWeb CDN and mounts a floating trigger button and accessibility control modal into document.body.
  3. Runtime DOM mutation & CSS overrides: When a user toggles an accessibility profile or adjustment (such as high contrast, text scaling, dyslexia-friendly fonts, or paused animations), the script:
    • Injects utility classes and inline <style> tags to override existing page styles.
    • Scans the live DOM and dynamically attaches aria-label, role, and tabindex attributes to elements missing semantic metadata.

Installation and Integration

1. Standard HTML Snippet

Place the configuration and loader script right before the closing </body> tag (or in <head> because the loader sets defer = true):

index.html
<script>
  window.interdeal = {
    sitekey: "YOUR_SITE_KEY",
    Position: "Left",
    Menulang: "EN",
    domains: {
      js: "https://cdn.equalweb.com/",
      acc: "https://access.equalweb.com/"
    }
  };

  (function(doc, head, body) {
    var coreCall = doc.createElement('script');
    coreCall.src = 'https://cdn.equalweb.com/core/4.5.2/accessibility.js';
    coreCall.defer = true;
    coreCall.setAttribute('data-core', 'equalweb');
    (doc.querySelector(head) || doc.querySelector(body)).appendChild(coreCall);
  })(document, 'head', 'body');
</script>

2. Single-Page Applications (React / Next.js)

In SPAs and meta-frameworks like Next.js, load the script once in the root layout so it persists across client-side route transitions without re-initializing:

app/layout.tsx (Next.js App Router)
import Script from 'next/script';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script id="equalweb-config" strategy="afterInteractive">
          {`
            window.interdeal = {
              sitekey: "${process.env.NEXT_PUBLIC_EQUALWEB_KEY}",
              Position: "Right",
              Menulang: "EN",
              domains: {
                js: "https://cdn.equalweb.com/",
                acc: "https://access.equalweb.com/"
              }
            };
          `}
        </Script>
        <Script
          src="https://cdn.equalweb.com/core/4.5.2/accessibility.js"
          strategy="lazyOnload"
          data-core="equalweb"
        />
      </body>
    </html>
  );
}

Configuration Reference (window.interdeal)

PropertyTypeDefaultDescription
sitekeystring(Required)Unique account identifier issued in the EqualWeb Portal.
Positionstring"Left"Horizontal anchor position in the viewport ("Left" or "Right").
Menulangstring"EN"Widget UI language code ("EN", "VI", "ES", "FR", etc.).
btn_horizontalnumber10Horizontal offset from the viewport edge in pixels.
btn_verticalnumber10Vertical offset from the viewport edge in pixels.
btn_sizestring"medium"Trigger button size ("small", "medium", or "large").
btn_shapestring"circle"Trigger button shape ("circle" or "square").
btn_colorstring"#0066cc"Hex color code for the widget trigger icon.
domains.jsstring"https://cdn.equalweb.com/"CDN origin serving the widget JavaScript assets.
domains.accstring"https://access.equalweb.com/"API origin used for license verification and audit logging.

Content Security Policy (CSP) Configuration

If your web server or CDN enforces a strict Content-Security-Policy header, allowlist the EqualWeb origins across the following directives:

Nginx / Cloudflare / Apache CSP Header
Content-Security-Policy:
  script-src 'self' https://cdn.equalweb.com;
  connect-src 'self' https://access.equalweb.com https://cdn.equalweb.com;
  style-src 'self' 'unsafe-inline' https://cdn.equalweb.com;
  font-src 'self' https://cdn.equalweb.com data:;
  img-src 'self' https://cdn.equalweb.com data:;
  frame-src 'self' https://access.equalweb.com;
[CSP Inline Style Requirement]

EqualWeb injects inline <style> blocks into the DOM whenever a user activates color, font, or contrast adjustments. Because these styles are generated dynamically at runtime, style-src must include 'unsafe-inline' unless your setup propagates a runtime CSP nonce to third-party scripts.

Performance & Core Web Vitals Impact

When adding a third-party DOM-scanning widget, monitor these Core Web Vitals metrics:

  1. Largest Contentful Paint (LCP): Always load the script with defer or Next.js strategy="lazyOnload" so it never competes with critical rendering resources or delays the LCP element.
  2. Total Blocking Time (TBT) & Interaction to Next Paint (INP): The widget bundle executes after the initial DOM is ready. On pages with large DOM trees (>1,500 nodes), automated DOM scanning and ARIA attribute patching can occupy the main thread for 50–150 ms.
  3. Cumulative Layout Shift (CLS): The floating trigger button uses position: fixed with explicit offsets (btn_horizontal, btn_vertical), so it does not shift document flow. However, make sure its coordinates do not overlap other floating UI elements such as live chat widgets (Zendesk, Intercom) or back-to-top buttons.

Technical Trade-Offs: Overlay vs. Native Remediation

CriterionEqualWeb OverlayNative Source Remediation
Rollout timeMinutes (drop-in script snippet).Weeks or months depending on codebase size.
End-user UI toolsBuilt-in toolbar (dyslexia font, contrast toggles, reading guide, cursor scaling).Must be custom-built or delegated to OS/browser accessibility settings.
Semantic HTML fixesCannot fix underlying source markup; applies heuristic runtime DOM patches.Fixes root causes in source code (e.g., replacing <div onClick> with <button>).
Screen reader compatibilityPartial; standalone screen readers (NVDA, JAWS, VoiceOver) can conflict with overlay overrides.First-class compatibility across standard assistive technologies.
Third-party dependencyRelies on EqualWeb CDN availability and third-party script execution.Zero external runtime dependencies.

Summary

  • Use EqualWeb when you need to quickly provide an on-page accessibility toolbar for visual adjustments while longer-term engineering remediation is underway.
  • Load the bundle asynchronously (defer / lazyOnload) and configure your CSP headers to prevent blocked assets in production.
  • Treat overlays as a supplement, not a replacement, for native accessibility: write Semantic HTML, manage keyboard focus properly, and author meaningful alt attributes directly in your source code.