feat: add a new skill for accessibility debugging and auditing with Chrome DevTools MCP.#1002
Conversation
…hrome DevTools MCP.
…napshot` instead of `evaluate_script`.
…tive checks and clarifying script limitations.
|
The code examples are hit or miss. Let;s see if I can make them better. |
…t snippets to be IIFEs with console logging for manual usage.
…n and add debugging logs to a11y tests.
|
I now tuned the js snippets a bit, so that gemini 2.5 pro is able to utilize them for effect. I think this looks good for now. |
|
|
||
| **Accessibility Tree vs DOM**: Visually hiding an element (e.g., `CSS opacity: 0`) behaves differently for screen readers than `display: none` or `aria-hidden="true"`. The `take_snapshot` tool returns the accessibility tree of the page, which represents what assistive technologies "see", making it the most reliable source of truth for semantic structure. | ||
|
|
||
| **Reading web.dev documentation**: If you need to research specific accessibility guidelines (like `https://web.dev/articles/accessible-tap-targets`), you can append `.md.txt` to the URL (e.g., `https://web.dev/articles/accessible-tap-targets.md.txt`) to fetch the clean, raw markdown version. This is much easier to read using the `read_url_content` tool! |
There was a problem hiding this comment.
Is read_url_content agent/model agnostic? Or will they be able to map that to whatever their own implemention is called?
| Chrome automatically checks for common accessibility problems. Use `list_console_messages` to check for these native audits first: | ||
|
|
||
| - `types`: `["issue"]` | ||
| - `includePreservedMessages`: `true` (to catch issues that occurred during page load) |
There was a problem hiding this comment.
If we instruct to use tools with such high specificity, how do we ensure they stay aligned to potential future API updates?
There was a problem hiding this comment.
As the skills are in the same directory as the tools, I would assume they will change in lockstep.
|
|
||
| 1. Locate buttons, inputs, and images in the `take_snapshot` output. | ||
| 2. Ensure interactive elements have an accessible name (e.g., a button should not just say `""` if it only contains an icon). | ||
| 3. **Orphaned Inputs**: Verify that all form inputs have associated labels. Use `evaluate_script` to check for inputs missing `id` (for `label[for]`) or `aria-label`: |
There was a problem hiding this comment.
I think there's a chance to shorten here. The model will be able to infer to check for inputs missing id(forlabel[for]) or aria-label`` from the following code snippet anyway.
| }; | ||
| ``` | ||
|
|
||
| ```` |
| 4. Check images for `alt` text. | ||
|
|
||
| ### 4. Focus & Keyboard Navigation |
| According to web.dev, tap targets should be at least 48x48 pixels with sufficient spacing. Since the accessibility tree doesn't show sizes, use `evaluate_script`: | ||
|
|
||
| ```javascript | ||
| // Usage in console: copy, paste, and call with element: fn(element) |
There was a problem hiding this comment.
Comment can be removed.
| }; | ||
| ```` | ||
|
|
||
| _Pass the element's `uid` from the snapshot as an argument to the tool._ |
|
|
||
| **Note**: This script uses a simplified algorithm and may not account for transparency, gradients, or background images. For production-grade auditing, consider injecting `axe-core`. | ||
|
|
||
| ```javascript |
There was a problem hiding this comment.
Nit: we could shorten this to js for every snippet, for token optimization.
| **Note**: This script uses a simplified algorithm and may not account for transparency, gradients, or background images. For production-grade auditing, consider injecting `axe-core`. | ||
|
|
||
| ```javascript | ||
| el => { |
There was a problem hiding this comment.
Not actionable for this PR, but is there an opportunity to expose this internal DevTools functionality through CDP? @OrKoN?
| Verify document-level accessibility settings often missed in component testing: | ||
|
|
||
| ```javascript | ||
| (() => { |
There was a problem hiding this comment.
Shouldn't this use evaluate_script instead of printing to the console? Because the later would require the list console messages tool.
🤖 I have created a release *beep* *boop* --- ## [0.18.0](chrome-devtools-mcp-v0.17.3...chrome-devtools-mcp-v0.18.0) (2026-02-24) ### 🎉 Features * `--slim` mode for maximum token savings ([#958](#958)) ([c402b43](c402b43)) * add a new skill for accessibility debugging and auditing with Chrome DevTools MCP. ([#1002](#1002)) ([b0c6d04](b0c6d04)) * add experimental screencast recording tools ([#941](#941)) ([33446d4](33446d4)) * add skill to debug and optimize LCP ([#993](#993)) ([2cd9b95](2cd9b95)) * add storage-isolated browser contexts ([#991](#991)) ([59f6477](59f6477)) * add take_memory_snapshot tool ([#1023](#1023)) ([7ffdc5e](7ffdc5e)) * support any-match text arrays in wait_for ([#1011](#1011)) ([496ab1b](496ab1b)) * support type_text ([#1026](#1026)) ([b5d01b5](b5d01b5)) ### 🛠️ Fixes * detect X server display on Linux ([#1027](#1027)) ([1746ed9](1746ed9)) ### ♻️ Chores * cleanup string and structured console formatters ([#1005](#1005)) ([0d78685](0d78685)) * extract version in a seprate file ([#1032](#1032)) ([0106865](0106865)) * move emulation settings to context ([#1000](#1000)) ([bc3c40e](bc3c40e)) * optimize slim tool descriptions and params ([#1028](#1028)) ([ca6635d](ca6635d)) * simplify JavaScript code examples, update code block language, and refine descriptions in a11y debugging skill documentation. ([#1009](#1009)) ([5cedcaa](5cedcaa)) * types for JSON output of IssueFormatter ([#1007](#1007)) ([9ef4479](9ef4479)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
…hrome DevTools MCP. (ChromeDevTools#1002)
🤖 I have created a release *beep* *boop* --- ## [0.18.0](ChromeDevTools/chrome-devtools-mcp@chrome-devtools-mcp-v0.17.3...chrome-devtools-mcp-v0.18.0) (2026-02-24) ### 🎉 Features * `--slim` mode for maximum token savings ([ChromeDevTools#958](ChromeDevTools#958)) ([c402b43](ChromeDevTools@c402b43)) * add a new skill for accessibility debugging and auditing with Chrome DevTools MCP. ([ChromeDevTools#1002](ChromeDevTools#1002)) ([b0c6d04](ChromeDevTools@b0c6d04)) * add experimental screencast recording tools ([ChromeDevTools#941](ChromeDevTools#941)) ([33446d4](ChromeDevTools@33446d4)) * add skill to debug and optimize LCP ([ChromeDevTools#993](ChromeDevTools#993)) ([2cd9b95](ChromeDevTools@2cd9b95)) * add storage-isolated browser contexts ([ChromeDevTools#991](ChromeDevTools#991)) ([59f6477](ChromeDevTools@59f6477)) * add take_memory_snapshot tool ([ChromeDevTools#1023](ChromeDevTools#1023)) ([7ffdc5e](ChromeDevTools@7ffdc5e)) * support any-match text arrays in wait_for ([ChromeDevTools#1011](ChromeDevTools#1011)) ([496ab1b](ChromeDevTools@496ab1b)) * support type_text ([ChromeDevTools#1026](ChromeDevTools#1026)) ([b5d01b5](ChromeDevTools@b5d01b5)) ### 🛠️ Fixes * detect X server display on Linux ([ChromeDevTools#1027](ChromeDevTools#1027)) ([1746ed9](ChromeDevTools@1746ed9)) ### ♻️ Chores * cleanup string and structured console formatters ([ChromeDevTools#1005](ChromeDevTools#1005)) ([0d78685](ChromeDevTools@0d78685)) * extract version in a seprate file ([ChromeDevTools#1032](ChromeDevTools#1032)) ([0106865](ChromeDevTools@0106865)) * move emulation settings to context ([ChromeDevTools#1000](ChromeDevTools#1000)) ([bc3c40e](ChromeDevTools@bc3c40e)) * optimize slim tool descriptions and params ([ChromeDevTools#1028](ChromeDevTools#1028)) ([ca6635d](ChromeDevTools@ca6635d)) * simplify JavaScript code examples, update code block language, and refine descriptions in a11y debugging skill documentation. ([ChromeDevTools#1009](ChromeDevTools#1009)) ([5cedcaa](ChromeDevTools@5cedcaa)) * types for JSON output of IssueFormatter ([ChromeDevTools#1007](ChromeDevTools#1007)) ([9ef4479](ChromeDevTools@9ef4479)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
No description provided.