2026.11.13 · 4 min · ai · agents · claude-code · html · browsers
Your AI still writes 2019 JavaScript.
Chrome's Modern Web Guidance 1.0 is a skill that teaches coding agents the native version of UI they usually hand-roll. The clearest case is a modal: about 30 lines of JavaScript become a button with commandfor and a <dialog>. What it is, how to install it in Claude Code, what it doesn't do, and why it still adds a polyfill line. As of 2026.11.
Ask a coding agent for a modal and you'll usually get the modal it learned from: a click handler, a backdrop div, an Escape listener, a focus trap, aria-hidden on the siblings, and code to put focus back when it closes. About 30 lines, and each one is a place to get focus or Escape slightly wrong. The browser has done all of it natively for years. Chrome's Modern Web Guidance is an attempt to make agents write that version instead.
Watch the 60-second version on Instagram.
What it is
Modern Web Guidance is a skill: a prompt plus a CLI that your coding agent reads, with guides for building UI on native platform features instead of hand-rolled JavaScript. Version 1.0 was published on 2026.11.10. It adds a modernization workflow, and Google describes it as "a cross-browser effort", with Firefox and Edge joining.
It isn't a code fixer. It changes what your agent writes next; it doesn't rewrite what you already have.
The modal, before and after
Here is the version the skill's dialog guide points the agent to:
<button commandfor="dlg" command="show-modal">Open</button>
<dialog id="dlg">
<p>Saved!</p>
<button commandfor="dlg" command="close">Close</button>
</dialog>command="show-modal" calls showModal() on the dialog, and that one call gives you what the 30 lines were for:
| Hand-rolled JS | What showModal() does instead |
|---|---|
| Backdrop element | The dialog goes to the top layer, with a ::backdrop you can style |
aria-hidden / disabling the page | The page behind becomes inert, and the dialog gets aria-modal="true" |
| Escape listener | Escape closes it |
| Moving focus in | Focus goes to the first focusable element |
| Restoring focus on close | Focus returns to the button that opened it |
<dialog> itself is Baseline Widely Available, since March 2022.
"No JavaScript" needs a footnote
The two lines above run with no JavaScript in current browsers. Invoker commands (commandfor and command) are Baseline Newly Available since 2025.12.12: Chrome and Edge 135, Firefox 144, Safari 26.2. That's not the same as Widely Available, which they're expected to reach on 2028.06.12.
That gap matters because the skill's default target is Baseline Widely Available, unless you set a different one in CLAUDE.md or AGENTS.md. For features that aren't Widely Available yet, the guides give a fallback, mostly progressive enhancement with a polyfill loaded only when it's needed. So today the agent still writes commandfor, and adds one line:
if (!('commandForElement' in HTMLButtonElement.prototype)) import('https://esm.run/invokers-polyfill');The honest summary is "no JavaScript you write", not "no JavaScript".
Install it in Claude Code
The interactive installer works for any supported agent:
npx modern-web-guidance@latest installFor Claude Code it's two commands. Adding the marketplace alone isn't enough:
claude plugin marketplace add GoogleChrome/modern-web-guidance
claude plugin install modern-web-guidance@googlechromeGoogle reports a "37 percentage point improvement in adherence" with the skill. That's Google's own early result, and it says the number varies by model, prompts and tools.
What people get wrong
- "It fixes my old code." It doesn't. It's guidance the agent reads. The
legacy-scancommand covers about 20% of the ~200 guides, only reports findings, and has no--fixflag; the agent does the refactor. - "
showModal()locks scrolling." It doesn't. Add it yourself:body:has(dialog[open]) { overflow: hidden }. - "The inert page is a focus trap." Not literally. Tab stays out of the page behind the dialog, but focus can still reach the browser's own UI.
- "Every dialog feature works everywhere." The
closedbyattribute isn't supported in Safari up to 26.5, so don't lean on it for closing behaviour yet. - "It's Chrome-only." The modal above runs in Chrome, Edge, Firefox and Safari at the versions listed, and the polyfill covers older ones.
The skepticism is fair, too. In the Hacker News thread (435 points), one commenter put it as "you can get 90% of the same result by saying 'use modern javascript and css'". Google's eval says otherwise, but that's Google's number.
On a client project I'd install it, write our Baseline target into CLAUDE.md so the agent isn't guessing, and still read every modal it writes for scroll lock.
The short version
- Modern Web Guidance 1.0 (2026.11.10) is a skill that teaches agents native platform UI.
- A ~30-line JS modal becomes a button with
commandforand a<dialog>;showModal()handles backdrop, inertness, Escape and focus. - Invoker commands are Newly Available, so under the default Widely Available target the agent adds a one-line conditional polyfill.
- In Claude Code, install with the marketplace command and
claude plugin install. - It guides new code;
legacy-scanflags about 20% of patterns and fixes nothing.
Sources: Chrome for Developers, Modern Web Guidance 1.0 · Get started · Modernization workflow · Declarative dialog and popover control guide · web-features, Invoker commands · MDN, <dialog> · HTML spec, dialog close steps · caniuse, dialog closedby · GitHub, GoogleChrome/modern-web-guidance · Hacker News discussion