Resume
← Blog

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

BEFORE / ~30 LINES OF JSBUILT INCLICK HANDLERBACKDROP ELEMENTESCAPE LISTENERFOCUS TRAPINERT PAGEARIARESTORE FOCUSAFTER / 2 LINES OF HTML<button commandfor="dlg" command="show-modal"><dialog id="dlg">…</dialog>+ 1-LINE POLYFILL FOR OLDER BROWSERSFIG. 01 / 30 LINES, 2 LINES

Here is the version the skill's dialog guide points the agent to:

modal.html
<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 JSWhat showModal() does instead
Backdrop elementThe dialog goes to the top layer, with a ::backdrop you can style
aria-hidden / disabling the pageThe page behind becomes inert, and the dialog gets aria-modal="true"
Escape listenerEscape closes it
Moving focus inFocus goes to the first focusable element
Restoring focus on closeFocus 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.

20222023202420252026202720282029<DIALOG>WIDELY AVAILABLE · 2022.03COMMANDFOR / COMMAND+ POLYFILLEXP. 2028.062025.12TODAYFIG. 02 / NEWLY VS WIDELY AVAILABLE

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:

dialog.js
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:

install.sh
npx modern-web-guidance@latest install

For Claude Code it's two commands. Adding the marketplace alone isn't enough:

claude-code.sh
claude plugin marketplace add GoogleChrome/modern-web-guidance
claude plugin install modern-web-guidance@googlechrome

Google 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-scan command covers about 20% of the ~200 guides, only reports findings, and has no --fix flag; 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 closedby attribute 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

  1. Modern Web Guidance 1.0 (2026.11.10) is a skill that teaches agents native platform UI.
  2. A ~30-line JS modal becomes a button with commandfor and a <dialog>; showModal() handles backdrop, inertness, Escape and focus.
  3. Invoker commands are Newly Available, so under the default Widely Available target the agent adds a one-line conditional polyfill.
  4. In Claude Code, install with the marketplace command and claude plugin install.
  5. It guides new code; legacy-scan flags 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