extension_screenshot
Take a screenshot of one open extension surface (popup, options, sidebar, newtab, history, bookmarks) or web page in a live extension_dev or extension_start session and save it as a .png file.
Quick start
Open the popup and take a screenshot of it for the store listing
How the agent uses it
It asks the browser for that page's own pixels over the session's debug port: CDP Page.captureScreenshot on Chromium, the debugger protocol's screenshot actor on Firefox, and WebDriver on Safari, where only web pages can be captured. It never captures the screen or another window and never brings a window to the front, so there is no need for screencapture, AppleScript or a Playwright script. The surface must already be open: open it with extension_open first. width and height set the viewport on Chromium and crop from the top left on Firefox; deviceScaleFactor sets the pixel ratio. The file goes under dist/extension-js/<browser>/screenshots unless path names one, and the answer gives its path and pixel size. Use extension_dom_snapshot for the page's structure as text.
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
| Group | local, on by default |
| Tier | See |
| Needs | a live dev or start session |
| Read only | no |
| Destructive | no |
| Idempotent | yes |
| Reaches the open web | no |
Inputs
| Input | Type | Required | Default | What it does |
|---|---|---|---|---|
projectPath | string | yes | Extension project root (needs a live dev session) | |
browser | string | no | Session browser; defaults to this project's live session. Required when the project runs sessions for more than one browser: the call is refused with the list rather than picking one. | |
context | "page" | "popup" | "options" | "sidebar" | "newtab" | "history" | "bookmarks" | no | "page" | page captures a tab picked by url (or the only or selected one); the rest capture that extension surface, which must already be open. |
url | string | no | page: the tab whose url contains this (a web address or the extension's own page url). | |
width | number | no | Viewport width in CSS pixels (Chromium renders at it; Firefox crops to it). | |
height | number | no | Viewport height in CSS pixels (Chromium renders at it; Firefox crops to it). | |
deviceScaleFactor | number | no | Pixel ratio of the image, 0.5 to 4. Defaults to the browser's own on Chromium and 1 on Firefox. | |
path | string | no | Where to write the image, relative to projectPath and inside it: a file name ending in .png (shots/home.png), or a folder with a trailing slash (shots/) that gets a timestamped .png. A path outside projectPath, or a file name that does not end in .png, is refused with E_BAD_REQUEST, so no other file is ever overwritten. Defaults to dist/extension-js/<browser>/screenshots. | |
timeout | number | no | Command timeout in ms. When omitted, the default depends on the route: 30000 through the dev session's control channel, 10000 over the Firefox debugger protocol, and 15000 per command over the Chromium debug port. |
When it fails
- The call is refused because no session is live. Start one with
extension_devorextension_startand call again.
Next
- MCP server: install, the two groups and the session gates
- Install in your client
extension_analyze: Analyze a BUILT extension on disk: file sizes, declared entry points, permissions, bundle composition, store-readiness checks, and manifestByBrowser, the emitted manifest of eve...extension_doctor: Diagnose a dev session end to end: ready contract, dev-server process, control-port agreement, control channel, eval token, executor, browser liveness.extension_dom_snapshot: Take a shallow structured DOM snapshot of one chosen surface through the agent bridge (localhost only; the snapshot itself needs no CDP, but listTargets andtabUrlresolution...extension_inspect: Inspect a running extension deeply over the browser's debugger protocol: full HTML (open shadow roots of #extension-root and [data-extension-root] hosts inlined; other shadow ro...extension_list_extensions: List the extensions in the running dev browser: id, name, version, and, on Chromium, live contexts.extension_logs: Read or stream logs from every context of a running dev session (service worker, content scripts, popup, options, sidebar, devtools, pages) in one ordered timeline.extension_manifest_validate: Validate a manifest.json across browsers.extension_theme_verify: Verify a Chrome theme manifest before it ships.