-
Notifications
You must be signed in to change notification settings - Fork 37
Browser Tool Usage
Web accessibility agents can autonomously navigate, test, and verify fixes in VS Code's integrated browser, creating a closed-loop "fix → verify → confirm" workflow.
Traditional workflow:
- Agent scans code → finds issues
- Agent suggests fixes
- Developer manually tests in browser
- Developer reports back if it worked
Browser-assisted workflow:
- Agent scans code → finds issues
- Agent applies fix to code
- Agent opens page in integrated browser
- Agent takes screenshot as evidence
- Agent verifies fix worked (or detects failure)
- Agent reports: "Fix applied and verified in browser"
Browser tools must be enabled in VS Code settings:
{
"workbench.browser.enableChatTools": true
}How to enable:
- Open VS Code Settings (Ctrl+,)
- Search for "browser chat tools"
- Check "Enable Chat Tools"
Or add to .vscode/settings.json:
{
"workbench.browser.enableChatTools": true
}- Dev server running — Application must be served locally (localhost:3000, :5173, :8080, etc.)
- VS Code 1.110+ — Browser tools are a v1.110+ feature
- Network access — Agent must be able to reach the dev server URL
| Tool | Purpose | Example |
|---|---|---|
open_browser_page(url) |
Navigate to URL in integrated browser | open_browser_page('http://localhost:3000') |
take_screenshot(selector?) |
Capture page or specific element | take_screenshot('.submit-button') |
click_element(selector) |
Click button/link for testing | click_element('#menu-toggle') |
fill_form(data) |
Fill form fields | fill_form({name: 'Test', email: 'test@example.com'}) |
After completing the audit and reporting findings, the wizard offers:
Would you like me to verify fixes in the integrated browser?
If yes:
- Detects if dev server is running (checks common ports)
- Opens page in integrated browser
- Takes screenshots of fixed elements
- Invokes web-issue-fixer with browser verification context
- Collects visual evidence
- Reports: "Fix applied and verified in browser"
After applying each fix:
- Takes screenshot of the affected element
- Comments in code: "Fix applied at line 42"
- If browser tools available:
- Navigates to page
- Takes before/after screenshots
- Reports: "Fix applied and verified"
- If browser tools unavailable:
- Reports: "Fix applied, manual verification recommended"
Without browser verification:
web-issue-fixer: Added alt="Company logo" at src/Header.tsx:12
User: *manually opens browser to check*
With browser verification:
web-issue-fixer:
Fix #1: Added alt="Company logo"
File: src/Header.tsx:12
Screenshot: [shows image with accessible name in browser]
Verification: PASS - Screen reader will announce "Company logo"
Evidence: http://localhost:3000/#header-logo
Without browser verification:
web-issue-fixer: Added focus management to modal at src/Modal.tsx:45
User: *manually tests keyboard focus with Tab key*
With browser verification:
web-issue-fixer:
Fix #3: Added focus trap to modal
File: src/Modal.tsx:45
Action: Opened modal, pressed Tab 5 times
Screenshot: [shows focus cycling within modal]
Verification: PASS - Focus stays within modal boundary
Focus order: Close button → Input → Submit → Cancel → Close button
web-accessibility-wizard:
I need a running dev server to verify fixes.
Checked ports: 3000, 5173, 8080, 4200, 8000 - none responding.
Would you like me to start your dev server?
Options:
- Run npm run dev
- Run npm start
- Specify custom command
- Skip browser verification (I'll still apply fixes)
web-issue-fixer:
Navigation failed: http://localhost:3000/dashboard
Error: ERR_CONNECTION_REFUSED
Possible causes:
- Dev server not started
- Incorrect port (expected 3000)
- Network/firewall issue
Fix: Applied to code ✓
Verification: Skipped (manual verification recommended)
web-issue-fixer:
Screenshot target not found: .submit-button
Taking full-page screenshot instead.
Fix: Added aria-label="Submit form" ✓
Screenshot: [full page view]
Verification: Code updated, but element not visible in current view.
Manual verification recommended.
web-accessibility-wizard (Phase 0):
Browser tools are not enabled. To use autonomous verification:
Add to settings.json:
{
"workbench.browser.enableChatTools": true
}
Would you like me to:
- Continue without browser verification (suggestion mode)
- Wait while you enable the setting (I'll detect when ready)
- Skip this audit and guide you through setup first
✅ Use browser verification for:
- Visual fixes (alt text, color contrast, focus indicators)
- Interactive fixes (keyboard navigation, focus management, ARIA states)
- Dynamic content (live regions, loading states, form validation)
- Layout/structure (heading order, landmark regions, skip links)
❌ Skip browser verification for:
- Build-time issues (missing lang on html)
- Static content without visual changes
- Server-side rendered content with no client interactivity
- API/backend accessibility issues
Browser verification adds time to the fix process:
- Page load: ~1-3 seconds
- Screenshot capture: ~0.5-1 second per element
- Interactive testing: ~2-5 seconds per interaction
Optimization:
- Batch fixes: Apply multiple fixes, then verify all at once
- Selective verification: Verify only high-priority or visual fixes
- Skip on re-runs: After initial verification, trust subsequent runs
Screenshots serve as:
- Proof of fix — Visual confirmation that change worked
- Audit trail — Documentation for compliance reporting
- Debugging aid — Shows what agent saw vs. expected state
- Training data — Future improvement of verification logic
Store screenshots in workspace:
- Location:
.a11y-screenshots/ - Naming:
{timestamp}-{fix-number}-{element-selector}.png - Include in audit reports as image embeds
Cause: Setting not enabled or VS Code version < 1.110
Fix:
// .vscode/settings.json
{
"workbench.browser.enableChatTools": true
}Then restart VS Code or reload window (Ctrl+Shift+P → "Reload Window")
Cause: Dev server not running or wrong port
Fix:
- Start dev server:
npm run devornpm start - Check console output for actual port (e.g., "Local: http://localhost:5173")
- Tell agent the correct port if non-standard
Cause: Page loaded before React/Vue hydrated
Fix: Agent should wait for DOMContentLoaded or framework-specific ready signal before screenshot
Agent behavior:
// Internal agent logic (not user-facing)
await page.waitForSelector('body.loaded', { timeout: 5000 })
await page.screenshot({ selector: targetElement })Possible causes:
- CSS hiding element — Element exists but visibility:hidden or display:none
- JavaScript override — JS removes/modifies the fix after page load
- Framework re-render — Fix not persisted through hot reload
- Timing issue — Agent checked before framework updated DOM
Agent should:
- Report the discrepancy clearly
- Include both the code snapshot and browser snapshot
- Suggest manual verification
- Offer to re-run after user confirms change saved
Browser verification results are included in audit reports:
## Issue #12: Missing Alt Text
**File:** src/components/Hero.tsx:45
**Element:** `<img src="/logo.png" />`
**WCAG:** 1.1.1 Non-text Content (Level A)
**Fix Applied:**
```tsx
<img src="/logo.png" alt="Company logo" />Verification: ✅ PASS
- Screenshot: ./a11y-screenshots/2026-03-04-12-45-logo.png
- Tested in: Chrome 122 (integrated browser)
- Screen reader impact: Will now announce "Company logo" instead of "logo.png"
- Date verified: 2026-03-04 12:45 UTC
## Future Enhancements
Planned improvements to browser-assisted verification:
- **Screen reader testing** — Invoke NVDA/JAWS/VoiceOver via automation APIs
- **Keyboard testing** — Simulate Tab/Enter/Escape sequences automatically
- **Contrast verification** — Measure actual rendered colors vs. stated values
- **Focus indicator detection** — Verify focus outlines are visible (WCAG 2.4.13)
- **Animation detection** — Check for motion compliance (prefers-reduced-motion)
- **Touch target measurement** — Verify 24x24px minimum (WCAG 2.5.8)
## See Also
- [Web Accessibility Wizard](../agents/web-accessibility-wizard.md) — Full audit workflow
- [Web Issue Fixer](../agents/web-issue-fixer.md) — Fix application with verification
- [Context Management](./context-management.md) — Managing long audit conversations
- [WCAG 2.2 Understanding](https://www.w3.org/WAI/WCAG22/Understanding/) — Official WCAG guidance
- Accessibility Lead
- Web Accessibility Wizard
- Document Accessibility Wizard
- Alt Text and Headings
- ARIA Specialist
- Contrast Master
- Forms Specialist
- Keyboard Navigator
- Link Checker
- Live Region Controller
- Modal Specialist
- Tables Data Specialist
- Word Accessibility
- Excel Accessibility
- PowerPoint Accessibility
- PDF Accessibility
- Office Scan Config
- PDF Scan Config
- Testing Coach
- WCAG Guide