a11y-toolkit: Keyboard-trap detector
a11y_keyboardDetects WCAG 2.1.2 keyboard traps by Tab-walking real focus stops in Chromium, testing Escape release for modal cycles, and returning tab stops plus findings.
Instructions
Keyboard-trap detection (2.1.2) with REAL Tab walking in Chromium: up to 60 real tab stops, cycle detection (the modal pattern), then the decisive test — does ESCAPE release the cycle? A modal that cycles and releases on Escape is correct and NOT reported; a cycle Escape cannot leave is a trap (high severity). Returns the full tab stop list too. Requires local Playwright. — Scope: keyboard traps (2.1.2); focus visibility is part of a11y_audit_dom. Returns JSON: {tab_stops, trap_detected, escape_releases, findings}. Run on pages with modals, dialogs or embedded apps; a plain content page has nothing to trap.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Page URL to Tab-walk (http/https or file://) | |
| lang | No | Output language (default en) | |
| browser | No | Browser engine (auto = detect the first available) | |
| max_steps | No | max real Tab presses (60 default) | |
| auth_state | No | Path to a Playwright storage_state JSON (exported session) to Tab-walk behind login |