screenshot
Capture the visible viewport or a specified region of a web page as a PNG. Use it to inspect pixel rendering, alignment, or visual state of a Chrome tab.
Instructions
Capture a PNG screenshot of the current viewport (the visible page area only — not the full scrollable page, not the browser chrome, not DevTools), or of one rectangle of it with region. Captured at the tab's native pixel size unless you cap it with maxEdge; a capture that was scaled or cut says so in a note beside the image, which for a region also gives the CSS rect the image covers and how many image pixels a CSS pixel became. A tab that is not painting is raised in its window first, which changes which tab is selected there.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | Capture only this rectangle instead of the whole viewport. CSS pixels, measured from the top-left of the visible area — the same space `getBoundingClientRect()` reports in, so an element's box can be passed straight through. Usually the right way to answer a question about exact pixels: a small region at native size costs far less than the whole viewport. Pad it a few pixels when judging alignment — an exact box crop puts the element's own antialiased edge in its outer row, and an offset only reads against its surroundings. Cut down to whatever part of it is on screen; a region entirely off screen is an error. | |
| maxEdge | No | Longest side of the returned image, counted in its own pixels rather than CSS pixels, so the same value gives the same image on a 1x and a 2x tab. Scales down `region` when one is given, the viewport otherwise. -1 (the default), or any value at or above the capture's native pixel size, returns native pixels — use that when the answer depends on exact pixels (1px offsets, blurred edges, subpixel text). Otherwise size it for whatever will read the image: cost scales with AREA, so halving this quarters it. |