Skip to content

extension_dom_snapshot ​

Take a DOM snapshot of one open extension surface or targetId, or list what is open (listTargets on the debug port or 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 ​

Answers counts, html or visible interactive elements with selectors; extension_inspect answers a web page in depth, extension_element_act acts, extension_eval runs code, extension_logs_read has console history.

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.
targetIdstringnoPage targetId (extension_open, extension_dom_snapshot listTargets); wins over url.
listTargetsbooleannofalseList page targets and return.
listTabsbooleannofalseList tabs with ids and return.
context"content" | "page" | "popup" | "options" | "side-panel" | "devtools" | "newtab" | "history" | "bookmarks"no"content"A closed surface is opened first (as extension_open does); the answer then says opened: true.
includearray of "summary" | "html" | "elements"no["summary"]summary: counts. html: markup to maxBytes. elements: visible interactive elements with role, name, unique selector and state.
maxBytesnumberno32768Byte cap on the html.
withConsolenumber | booleannoConsole lines: a count, or true for 50.
browserstringnoRunning session's browser; needed 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 three groups and the session gates
  • Install in your client
  • extension_analyze: Analyze a built extension in dist/<browser>: total and shippable size, entry points, permissions and store checks.
  • extension_doctor: Diagnose a dev session leg by leg, each with its remediation.
  • extension_inspect: Inspect a web page or targetId in a running session, first navigating a tab to url when given: its HTML, DOM, console and CSS selector counts, closed shadow roots too.
  • extension_installed_read: List the extensions installed in a running session's browser, read-only; the project's own row has ownExtension:true.
  • extension_logs_read: Read a dev session's console from every context in one timeline, or follow:true for live lines after the replayed ones.
  • extension_manifest_validate: Validate manifest.json against each browser: per-browser errors, permissions the code calls but lacks, and buildBlocking errors.
  • extension_screenshot: Take a .png of one surface, page or targetId in a live session; a closed surface is opened first, answering opened: true.
  • extension_theme_verify: Verify a Chrome theme manifest, not an extension's: the colors Chrome paints and the keys it drops.