Skip to content

extension_dom_snapshot ​

Take a shallow DOM snapshot of one open surface or targetId, or list what is open (listTargets on the debug port, listTabs).

Quick start ​

Snapshot the popup and tell me what it rendered

Asked what a surface rendered, the agent runs the extension and snapshots the page.

Asked what a surface rendered, the agent runs the extension and snapshots the page.

How the agent uses it ​

Closed shadow roots and probes: extension_inspect.

Page text in the answer ​

Part of this tool's answer is text a web page or the extension wrote. The server fences it between <untrusted-data-ID> and </untrusted-data-ID> with a fresh random ID per call, named in untrusted.boundary. A fence is a signal to the model, not a gate: pair it with --no-ship when the agent reads pages you do not trust. See Server flags and telemetry.

Reference ​

Grouplocal, on by default
TierSee
Needsa dev session, which carries control unless started with allowControl: false
Read onlyyes
Destructiveno
Idempotentyes
Reaches the open webno

Inputs ​

InputTypeRequiredDefaultWhat it does
projectPathstringyesProject root of a running session: extension_dev, extension_start, or npx extension dev|start by hand
tabnumbernochrome.tabs id; else url, else the active tab.
urlstringnocontent/page: the tab by url.
tabUrlstringnoThe tab by url from the target list.
targetIdstringnoA page's targetId (extension_open, or dom_snapshot listTargets); overrides url.
listTargetsbooleannofalseList page targets and return.
listTabsbooleannofalseList tabs with ids and return.
context"content" | "page" | "popup" | "options" | "sidebar" | "devtools" | "newtab" | "history" | "bookmarks"no"content"Surfaces must already be open (extension_open).
includearray of "summary" | "html"no["summary"]What to include.
maxBytesnumberno262144Byte cap on the html.
withConsolenumber | booleannoConsole lines: a count, or true for 50.
browserstringnoSession browser; required when several run.
timeoutnumbernoTimeout ms (default 30000; Firefox 10000; debug port 15000).

When it fails ​

  • The call is refused because no session is live. Start one with extension_dev or extension_start and call again.
  • The control channel is off. The session was started with allowControl: false. Start it again without that flag.

Next ​

  • MCP server: install, the two groups and the session gates
  • Install in your client
  • extension_analyze: Analyze a BUILT extension in dist/<browser>: sizes, entries, permissions, store checks (not on a dev build).
  • extension_doctor: Diagnose a dev session leg by leg, each with its remediation; run it first when an act tool errors unexpectedly.
  • extension_inspect: Inspect a web page (or targetId) over the debugger protocol: HTML, DOM, console, probes, closed shadow roots.
  • extension_list_extensions: List the extensions in a session's browser; its own carries ownExtension:true.
  • extension_logs: Read a dev session's logs from every context in one timeline, or follow:true for live frames after the replayed ring.
  • extension_manifest_validate: Validate a manifest.json across browsers; buildBlocking lists the errors that make extension_build refuse.
  • extension_screenshot: Take a .png of one open surface, page or targetId in a live session (Safari: pages only); open it with extension_open first.
  • extension_theme_verify: Verify a Chrome theme manifest headless: the colors Chrome would paint and the keys it discards.