1. High-Level Summary (TL;DR)
- Impact: Medium. One stuck page can no longer hang the daemon, and with it every other caller: JavaScript dialogs are tracked and handled, and every CDP call has a deadline. Five commands and nine flags are new. Several outputs changed shape, and some commands now fail where they used to hang or act blindly (see Breaking Changes), but no flag, command or exit code was removed or renamed.
- Key Changes:
- 🛡️ No More Hangs: A dialog left open by one command made the next one wait forever, and so did a call with no answer. Now a command on that page fails at once, naming the dialog (the "Leave site?" of
navigate --back / --forward included), and evaluate --dialog-action answers it. A call with no answer gives up after 180 s (CHROME_CDP_TIMEOUT_SECS), asking Chrome to stop a running script, and the calls that attach to a tab give up after 10 s. A browser that goes quiet for 30 s mid-call gets a ping, and a connection that died without closing ends the daemon 15 s later.
- 🍪
cookies: Reads the cookies Chrome stores for the page's URL, HttpOnly and partitioned ones included, over the daemon's already-approved connection, so the browser asks for no new approval. Values are hidden unless you ask (--header, --json, --toon). It is a lookup by URL, not what a particular request sent; network --request-headers shows that when Chrome reports it.
- 📡 Network Headers and Mocks:
network --request-headers --response-headers shows what each request carried and what came back, including the Cookie and Set-Cookie headers the page itself can't see. mock-network answers or fails a tab's requests (not a cross-site iframe's own) with a status, headers and a body of your choice.
- 🎨
css-styles: Shows why an element looks the way it does: computed values, the matched rules from highest precedence down, which declarations lost and why, var() values resolved, and what it inherits.
- 🔑
configure-webauthn: A virtual passkey or security-key authenticator on the tab, so sign-in flows can be tested without hardware or a system dialog.
- 🧠 Heap Snapshots Like the Memory Panel:
compare-heapsnapshots groups objects as the DevTools Memory panel does, detached DOM included, pages its output, and in a class's detail marks objects that only changed class (alsoIn) or size (~). inspect-heapsnapshot-node shows who retains a node and the retaining path from the page's roots, WeakMap entries included. take-heapsnapshot keeps V8's object IDs stable between captures of a tab, and gives up when the snapshot stops arriving.
- 🎯 Input That Hits Its Target:
click and hover refuse an element another one covers, naming the cover, instead of clicking the overlay. Key specs are checked before anything is typed, and emulate, navigate and new-page check --viewport and --geolocation before changing any override.
- 🧭 Smaller Additions:
emulate --media / --media-feature (print, dark mode, reduced motion), new-page --background, page errors raised during a command listed on stderr, and tabs a click or key press opens reported as [opened: name url] (a tab with no evidence the action opened it, such as one the human opened, as [new tab: name url]).
2. Visual Overview (Code & Logic Map)
graph TD
%% Business Goals
BG1["One Stuck Page Can't Hang the Daemon"]:::goal
BG2["See and Shape Network Traffic"]:::goal
BG3["Explain Why an Element Looks the Way It Does"]:::goal
BG4["Test Passkey Sign-in"]:::goal
BG5["Find Memory Leaks"]:::goal
BG6["Output That Can't Fool a Reader"]:::goal
BG7["Act Only on What Was Named"]:::goal
%% Files/Modules
subgraph "src/cdp.rs (Connection)"
C1["read_text_for_call(): per-call deadline"]
C2["check_alive(): bounded ping"]
C3["open_dialog / settle_open_dialog()"]
C4["answer_paused_requests()"]
end
subgraph "src/commands/executor.rs (Dispatch)"
E1["dialog_opened_by_input()"]
E2["page_errors_since()"]
end
subgraph "src/commands: input.rs, navigate.rs, emulation.rs (Input)"
I1["element_center_js(): hit test"]
I2["new_tab_notes(): opened vs new tab"]
I3["wait_for_event_from_session(): Leave-site dialog"]
I4["EmulateParams::validate()"]
end
subgraph "src/commands (Network)"
N1["network.rs: wire headers per hop"]
N2["network_mock.rs: reply_to_paused()"]
N3["cookies.rs: Network.getCookies"]
end
subgraph "src/commands/css.rs (Cascade)"
S1["cascade(): layers, !important, revert"]
S2["PAGE_INFO_JS: var() values, labels"]
end
subgraph "src/commands/webauthn.rs (Passkeys)"
W1["configure_webauthn()"]
end
subgraph "src/commands/memory.rs (Heap)"
H1["assign_classes(): Memory-panel grouping"]
H2["bfs_from_root(): WeakMap pairs"]
H3["inspect_node(): retainers, path"]
H4["compute_class_node_detail(): ~ rows, alsoIn"]
H5["take_heapsnapshot_within(): per-chunk deadline"]
end
subgraph "src/format.rs & src/remote_object.rs (Output)"
O1["strip_terminal_escapes()"]
O2["describe(): previews, thrown values"]
end
BG1 <--> C1
BG1 <--> C3
BG2 <--> N1
BG2 <--> N2
BG2 <--> N3
BG3 <--> S1
BG4 <--> W1
BG5 <--> H1
BG5 <--> H3
BG5 <--> H4
BG6 <--> O1
BG6 <--> I2
BG7 <--> I1
BG7 <--> I4
C1 --> C2
C3 --> E1
I3 --> C3
H5 --> C1
C4 --> N2
S2 --> S1
H2 --> H3
E2 --> O2
classDef goal fill:#e3f2fd,color:#0d47a1,stroke:#0d47a1,stroke-width:2px;
3. Detailed Change Analysis
🛡️ Dialogs and Deadlines
- Component:
Connection (src/cdp.rs), Dispatch (src/commands/executor.rs), Navigation (src/commands/navigate.rs)
- What Changed: While a JavaScript dialog is open the page answers no CDP call, and Chrome announces the dialog once, only to the sessions that had
Page enabled. The daemon now records a dialog from whichever read sees it, per session, and every later call on that page first answers it with evaluate's --dialog-action or fails at once with a typed error that says how to answer it. Every call also has a deadline, counted from before its request is written: 180 s by default (CHROME_CDP_TIMEOUT_SECS, read when the daemon starts), and 10 s for the calls that set a session up (Network.enable, Runtime.enable, Page.enable, the blocklist write); restoring a tab's saved media, authenticator or mocks gets the ordinary limit. When the socket is quiet for 30 s mid-call, and once more at the deadline, the daemon pings the browser, so a call can run up to 15 s past its limit. A write that doesn't finish counts as a lost connection.
- Input Commands: When
click, click-at, fill, type-text, press-key or hover opens a dialog itself, it reports success and names the dialog, since a retry would act twice; a dialog from the mouse press reports Pressed at (x, y), and type-text --submit-key says the key's outcome is unconfirmed. A dialog that opens while the command is getting ready (a mouseover or focus handler), or was already open, fails it, since the action was never sent; a fill has cleared the field by then.
- Behavior:
| Situation |
Before |
Now |
A command on a page with an open alert() |
Waited forever |
Fails at once with A javascript dialog is open (alert: …); evaluate --dialog-action accept|dismiss|<text> true answers it |
click on a button whose handler calls confirm() |
Waited forever |
Clicked, and the page opened a confirm dialog: "…" |
navigate --back from a page whose beforeunload asks "Leave site?" |
Waited forever |
Fails at once with the dialog's type and text |
evaluate 'while(true){}' |
Held the daemon forever |
Stopped after 180 s with got no answer from the page |
| The browser went away without closing the socket |
Waited forever |
The daemon pings after 30 s of quiet and exits 15 s later |
| A dialog the daemon never saw (opened before its session reached the tab) |
Waited forever |
Fails once the 10 s setup budget runs out, saying a dialog may be open and pointing at close-page |
- Tested: Unit tests cover the dialog bookkeeping, the deadline arithmetic, the success rule for input commands and, against a fake browser, a "Leave site?" during a history traversal. Live, on headless Chrome 158: alerts, confirms and prompts opened by
evaluate, click and page timers, an endless loop, and a dialog opened before the daemon attached.
🍪 cookies
- Component:
src/commands/cookies.rs
- What Changed: Page JavaScript can't see HttpOnly cookies, so a caller that needed a session cookie had to open its own DevTools connection, and the browser asked the user to approve it again.
cookies asks the page's own session with Network.getCookies, so it returns the cookies stored for the page's URL (or each --url) with no new prompt. It is a lookup by URL: a SameSite=Strict cookie can be in it but absent from a cross-site navigation to the same URL, so use network --request-headers for the headers a request actually sent.
- Behavior:
| Command |
Prints |
cookies |
A table of name, domain, path, expiry, flags and value length; no values |
cookies --name sid --header |
sid=…, one Cookie header ready for curl or a tunnel client, for one URL (the page's or a single --url); warns when two cookies share a name and path length |
--json cookies |
Every field Chrome returns, values included |
- Privacy: Values go to stdout only. Telemetry records the command name and timing, and the daemon logs no responses.
📡 Network Headers
- Component:
src/commands/network.rs, src/cdp.rs
- What Changed:
network listed only URL, method, type and status. --request-headers and --response-headers add each request's and response's headers. They are the headers that went over the wire when Chrome reports them (Network.requestWillBeSentExtraInfo / responseReceivedExtraInfo), so Cookie and Set-Cookie are included, and each redirect hop shows its own. A hop answered from the cache or a service worker shows what the page sees. Text output adds curl-style > name: value and < name: value lines; --json and --toon add requestHeaders and responseHeaders.
- Behavior: After a login POST answered with
302 and Set-Cookie, network --request-headers --response-headers lists the POST with its 302, < set-cookie: sid=… under it, and the redirected GET with > cookie: sid=…. Headers print only when asked for, since they can carry credentials.
🎭 mock-network and remove-network-mock
- Component:
src/commands/network_mock.rs, src/cdp.rs, src/daemon.rs
- What Changed: A tab's requests that match a URL glob (
* any characters, ? one) are answered by the daemon through the Fetch domain: --status, --header, --body or --body-file, or --abort to fail them, optionally only for one --resource-type (types interception can't filter on, such as WebSocket and Manifest, are rejected). The latest matching mock wins, and the HTTP cache is off while any is set. Mocks belong to the tab and live on the daemon's session, which keeps answering between commands, so the page never waits on one. mock-network with no pattern lists the mocks with their hit counts.
- Body Text: Text that starts with a dash goes attached, as in
--body=-1, so --body never takes the next flag (--abort) as its text.
- Behavior:
| Command |
Effect |
mock-network '*/api/user*' --body '{"name":"Test"}' --header 'Content-Type: application/json' |
fetch('/api/user') gets that JSON with status 200 |
mock-network '*.png' --abort --resource-type Image |
Images fail as a network error |
remove-network-mock |
Removes every mock on the tab |
🎨 css-styles
- Component:
src/commands/css.rs
- What Changed: A new command for the first element matching a selector, built on
CSS.getMatchedStylesForNode and the CLI's own cascade, so it can say which declarations lost:
- Computed:
display, width, height and what the shown rules set; --computed adds more.
- Properties currently set by a running animation or transition are marked indeterminate instead of active, and the report notes that its reads may reflect different states.
- Rules: In normal precedence order, highest first (an
!important declaration can beat a rule above it), each with file:line and its enclosing @media / @layer / @supports / @container / nesting. [overridden], [invalid] and [disabled] mark declarations that don't apply, and each var() shows what it resolves to.
- Inherited from: The rules of ancestors whose inheritable properties reach the element, and any property the element sets to
inherit.
- Cascade Details: It follows
!important with layers reversed, inherit / unset / revert / revert-layer, presentational attributes, @property registrations, property-name case, flow-relative longhands (margin-inline-start is margin-left in left-to-right text), and a var() that resolves to nothing, or to a value the property rejects, which acts as unset. CSS-wide keywords count after var() substitution, as in Chrome.
- Tested: 69 unit tests, and live checks of each rule against
getComputedStyle on Chrome 158.
🔑 configure-webauthn
- Component:
src/commands/webauthn.rs, src/cdp.rs
- What Changed: Adds, changes, shows or removes a virtual WebAuthn authenticator on the tab:
ctap2 or u2f, an internal (Touch ID–like) or roaming transport, resident keys and user verification, and --is-user-verified false to test a failed verification. Switching to u2f turns resident keys and user verification off, since u2f has neither. With no flags it shows the authenticator and its credentials (private keys are never printed). Chrome answers WebAuthn only in the front tab, so it warns about a background one. Chrome removes an authenticator when the session that added it detaches, so it lives on the daemon's session for the tab and is re-created when the CLI comes back from another tab.
🧠 Heap Snapshots
- Component:
src/commands/memory.rs
- What Changed:
- Grouping:
compare-heapsnapshots groups objects into classes as the DevTools Memory panel does, detached DOM and constructor locations included, so its rows match what you see there.
- Object Detail:
--class-index lists a class's objects largest change first: + entered the class, - left it, and ~ stayed and changed size, with its previousSize. alsoIn marks a + or - whose ID the other capture has too: the object entered or left the class (a <div> that got detached) rather than being allocated or freed.
- Paging: Both heap commands print 50 rows by default;
--limit and --offset page through the rest, and --max-name-length cuts long names.
- Retainers:
inspect-heapsnapshot-node lists the node's retainers and its retaining path from the page's roots, else from V8's GC roots. A WeakMap value counts as reached only through both its key and its table, and the step that waits on the other one says so (Step 5 is conditional: …).
- Stable IDs Between Captures:
take-heapsnapshot leaves the heap profiler on. Turning it off made V8 give surviving objects new IDs that overlapped the old ones, so the next diff paired unrelated objects without a warning. IDs still reset when a command targets another tab in between, when the daemon exits, or when another debugger detaches from the tab. A capture on a one-off session (no daemon, or it couldn't attach) warns that its IDs may not match earlier ones.
- A Deadline for Captures:
take-heapsnapshot gives up like any call when the snapshot stops arriving, after the same liveness checks, but its clock restarts with each chunk, so a big heap takes as long as it keeps coming. 2.4.0 waited forever.
- Robustness: Element indices past 2³¹, which V8 prints as negative numbers, load. Truncated or inconsistent files (duplicate node IDs, edge or location tables that don't add up) are rejected as corrupt instead of misread.
🧾 Output
- Component:
src/format.rs, src/remote_object.rs, src/commands/snapshot.rs
- What Changed: Page text can no longer send escape sequences to your terminal: text output strips control characters (a lone carriage return becomes a newline),
--json escapes them, and TOON keeps them only when stdout isn't a terminal. Console arguments print from their preview ({id: 3}, Map(1) {'k' => 1}), and thrown non-Error values are named (Uncaught boom). snapshot prints an indented outline in document order, without line fragments or text that repeats its parent's name, and quotes each name as a JSON string, so a line break inside one can't start a row of its own.
4. Fixes
- 🐛 Values starting with
- were taken for flags. fill '#q' -hello printed help and exited 0, and negative coordinates and latitudes were rejected. They now reach fill, type-text, wait-for, evaluate, click-at and --geolocation. A mock's --body is the exception: attach such text, as in --body=-1.
- 🐛
click and hover could hit the wrong element. They now scroll it into view, aim at a visible part of it, and check that the point hits it (a label counts as its control). An element under an overlay (a cookie banner, a sticky header), hidden, or without a box fails the command, naming what covers it, instead of the overlay getting the click, and a click whose target keeps moving under the pointer isn't sent.
- 🐛 A bad
--viewport or --geolocation left other overrides half-applied. emulate, navigate and new-page now check them, and the media flags, before changing anything, so a command that fails leaves every override as it was.
- 🐛 Screenshot limits ignored HiDPI and browser zoom.
--max-width / --max-height count image pixels now, and clips account for zoom. A full-page capture past 16384 px warns.
- 🐛 A mistyped key was sent anyway.
press-key Ener sent a key no page reacts to and reported success, and type-text typed its text before checking --submit-key. Key specs are now checked before anything is typed. press-key also types any single character, !@#$%^&*() included, Shift applies as on a US keyboard (Shift+1 types !), and shortcuts such as Ctrl+S reach the page with the key and key code a keyboard sends.
- 🐛 Navigation reports missed some navigations. Same-URL reloads, form posts back to the same URL and navigations a script schedules now print
[navigated to: …]. navigate --reload, --back and --forward wait for the new document, where they could return while the old one still showed; a reload tells documents apart by Chrome's loader ID, and an entry an iframe made waits for that iframe.
- 🐛 Heap diffs could mislead. An object that changed class looked freed in one class and allocated in another (
alsoIn now says so), and take-heapsnapshot turned the profiler off, so the next capture renumbered every object (see Heap Snapshots).
- 🐛 Another local user could reach the daemon. On Unix, both ends of the daemon socket now check that the other side runs as the same user.
- 🐛 A stale daemon was silent. Responses carry the daemon's version, and the CLI warns when it differs from its own.
- 🐛
emulate ignored --json and --toon, and sw-logs --json printed plain text when there were no extension service workers. Both print JSON now.
- 🐛 Third-party tools:
list-3p-tools and execute-3p-tool fire the devtoolstooldiscovery event on pages without WebMCP, and tool parameters must be a JSON object.
5. Impact & Risk Assessment
⚠️ Breaking Changes
- Calls have deadlines. A CDP call with no answer stops after 180 s (
CHROME_CDP_TIMEOUT_SECS), so an evaluate or run-script that runs longer fails, with a stop requested for its script. Attaching to a tab gives up after 10 s, so a tab busy in a long script fails instead of waiting. take-heapsnapshot fails once no chunk has arrived for 180 s.
- Hangs became errors. A command on a page with an open dialog fails at once instead of waiting, and an input command whose own action opened one succeeds with a sentence naming it. A browser that doesn't answer a ping within 15 s ends the daemon, and the command fails with exit code 9.
- Input commands check before acting.
click and hover fail on an element that is covered, hidden, has no box or can't be scrolled into view, naming what covers it, and click fails when its target keeps moving. An unknown key or modifier fails before anything is typed. press-key with a single character types it, and shortcut letters arrive lowercase with a real key code.
- Navigation waits longer.
navigate --reload, --back and --forward wait up to 30 s for the new document, so they can take longer, or time out, where 2.4.0 returned on the old one.
- New stderr lines:
[opened: …], [new tab: …], [page error] …, [warning] for a daemon of another version, a screenshot past 16384 px or an ambiguous cookie header, a note on one-off heap captures, and [navigated to: …] for more navigations. stdout is unaffected, but a script that treats any stderr as failure will notice.
- Heap output changed shape, in every format. Both heap commands print 50 rows by default (2.4.0 printed every row) and cut names past 100 characters;
--limit, --offset and --max-name-length change that. Class names follow the Memory panel. compare-heapsnapshots adds a location column after className and a "showing" line before the CSV; --class-index orders objects by size change and adds previousSize and alsoIn columns and ~ rows. inspect-heapsnapshot-node adds class, type, detachedness, distance, retainers and a retaining path. --json keeps the 2.4.0 keys and adds new ones.
- Other output.
snapshot text is the new outline (--json is still Chrome's raw tree). Console text, in every format, prints objects from their previews, and the daemon keeps 10,000 characters of each string it buffers. Thrown non-Error values read Uncaught boom. Text output drops control characters from page text even when piped. emulate --json / --toon print JSON.
- Screenshots with
--max-width / --max-height come out smaller on HiDPI screens, since the limits count image pixels.
- Arguments. Dash-leading values are values now, not flags (see Fixes).
execute-3p-tool parameters must be a JSON object, and a --viewport side above 10,000,000 is rejected.
- Daemon and tools. On Unix the daemon and CLI refuse a peer running as another user, and pages without WebMCP get a
devtoolstooldiscovery event from list-3p-tools and execute-3p-tool.
📋 Upgrade Notes
- An older daemon keeps serving until it has been idle for 5 minutes. Until then the CLI warns that it runs an older version, and commands and flags added in 2.5.0 fail there with
Unknown argument(s). Don't kill it to hurry this up: the browser may ask the human to approve the new connection.
CHROME_CDP_TIMEOUT_SECS is read when the daemon starts, so set it for the command that starts one.
- Mocks, CSS media emulation and virtual authenticators need the daemon. They live on its session for the tab; without it those commands fail rather than set something that ends with the command.
- Heap snapshots to compare: take both with
take-heapsnapshot on one tab, with no command for another tab in between and the daemon running throughout (caffeinate keeps it up).
- After a lost connection, reconnect with a read-only command such as
list-pages, with the same browser selection flags, then check whether the original action took effect before repeating it.
- The skill and docs changes are not in the zip. It holds only the binary. Copy
skill/chrome-devtools/ from the repo over your installed skill to get the new commands and the new failure messages.
🔍 Known Limitations
- A dialog the daemon didn't see open can't be handled: one opened before its session reached the tab, or still open when the CLI moved to another tab and back. Commands there fail once the 10 s setup budget runs out, and a human has to close it, or
close-page the tab; the same goes for a page that opens dialogs in a loop.
css-styles doesn't cover pseudo-elements, @keyframes, or elements inside iframes or shadow roots.
cookies answers for the page's own site, so a partitioned cookie set by a cross-site iframe isn't included.
mock-network catches only the tab's own requests: a cross-site iframe running in another renderer process reaches the network. Service workers can answer requests before they reach a mock. --resource-type XHR, Fetch and EventSource each match all three, since Chrome doesn't tell them apart when it intercepts. --body-file must be a regular file of at most 64 MiB, since the daemon reads it.
network still drops POST bodies, initiator stacks and timing.
configure-webauthn: working on another tab drops the authenticator's credentials; it comes back with the same options but empty.
- Windows: the daemon listens on a loopback TCP port, which has no peer identity to check.
- Tracked for a redesign: findings that need more than a patch are open as issues #29–#36: sentences under
--json from action commands (#29), unnoticed heap ID renumbering (#30), css-styles ancestor details (#31), mock replies racing activation (#32), navigation waits without the liveness check (#33), emulate state on one-off sessions (#34), telling an input's own dialog from the page's (#35), and wire headers on split redirect chains (#36).