Emmanuel BalogunFrontend & Full-Stack Developer
--:--:-- WAT

06Accessibility · Chrome extension

Focus Lens

See a page the way a keyboard does

A Chrome extension and an installable demo, built from one codebase, that numbers every tab stop on a page, draws the path between them and points at where keyboard and screen reader users get stuck — focus traps, unnamed controls, failing contrast and removed focus rings.

Year
2026
Role
Frontend developer · Accessibility
Stack
TypeScript · React 19 · Chrome Extension (Manifest V3) · Vite + CRXJS · Shadow DOM overlay · vite-plugin-pwa · Vitest · Playwright + axe-core · GitHub Actions
Focus Lens auditing a sample cinema booking page: numbered tab stops joined by a path, a dashed red loop around a chat widget that traps focus, and a report panel listing nine issues
PlateThe demo’s broken cinema page — numbered tab stops, a focus trap in the chat widget and nine issues in the report.
A — The problem

Automated checkers catch contrast and missing landmarks, but they miss the problems that stop a keyboard user cold — a chat widget that traps focus, or a field whose only label is its placeholder. I wanted a tool that makes those visible on the page itself, with a fix for each one.

B — What it does
  • 01Finds keyboard traps, missing accessible names, placeholder-only labels, text contrast failures, positive tabindex jumps, hidden focus styles, unreachable controls and skipped headings.
  • 02Every issue explains what goes wrong for a person, what to change, a code snippet where it helps and a “Show on page” button.
  • 03Reports export as Markdown or JSON, or copy as a ready-to-paste GitHub issue or checklist.
  • 04The demo pairs the panel with a deliberately broken page: fix each flaw and watch the audit change.
C — Decisions & trade-offs
  1. D-01

    Find traps by asking the page

    Static analysis cannot see a keydown handler that wraps focus, and a content script cannot press Tab. So the audit focuses each stop, sends it a synthetic Tab and follows wherever the page’s own script moves focus, then restores focus and scroll when it is done.

    Trade-offThe audit briefly runs the page’s own code, but it finds a trap that axe-core misses on the same page — and an end-to-end test checks both tools against it.

  2. D-02

    One panel, two sources

    The report panel talks to an interface with four methods. The demo audits a sample page in an iframe; the extension sends messages to a content script in the active tab. Everything above that line is shared code.

    Trade-offThe engine had to work across documents, which meant replacing instanceof checks that break in frames.

  3. D-03

    Contrast fixes that keep the brand

    Suggestions only move the lightness of the more saturated colour, so an orange button gets a deeper orange rather than grey. Ratios are rounded down, so 4.499:1 reads as a fail.

    Trade-offThe suggestion is not always the closest passing colour mathematically, but it is one a designer would accept.

D — Outcome
8kinds of check, each mapped to a WCAG criterion
0axe violations in the tool’s own demo shell and panel, checked in CI
4permissions requested by the extension, and nothing leaves the browser
E — Known limits
  • Automated checks find roughly a third of real accessibility problems; this does not replace testing with a keyboard and screen reader.
  • It reads same-origin stylesheets only and does not look inside cross-origin iframes or judge contrast over images.