Screenshot
Capture the page and get back a URL to the image.
screenshot
Take a screenshot of the current viewport, the full page, or a specific element. Returns a public URL to the image.
Value: "viewport" | "fullpage" | CSS selector
Capture what's currently visible on screen:
[
{ "screenshot": "viewport" }
]
Capture the entire page from top to bottom:
[
{ "screenshot": "fullpage" }
]
Capture a specific element:
[
{ "screenshot": "#chart" }
]
Returns:
{ "success": true, "url": "https://files.browserworker.app/screenshots/..." }
Add padding around an element screenshot:
[
{ "screenshot": "#chart", "options": { "padding": 20 } }
]
Options
| Option | Type | Default | Description |
|---|---|---|---|
padding | number | 0 | Extra space (px) around the captured element. Only applies to element selectors. |
How each mode works
"viewport"— single capture of what's visible right now"fullpage"— scrolls to the top, captures in segments, hides sticky/fixed headers after the first segment so they don't repeat, then stitches everything into one tall image- CSS selector — scrolls to the element, captures it; large elements are captured in segments and stitched automatically
On high-DPI screens the image dimensions will be larger, matching the device pixel ratio.
Unsupported inside loop and if
screenshot cannot be used inside loop or if branches.
Example: Screenshot After Data Loads
[
{ "openNewTab": "https://example.com/dashboard" },
{ "waitForEvent": "networkidle" },
{ "waitForElement": ".chart", "options": { "visible": true } },
{ "screenshot": "viewport" }
]