Skip to content

Screenshots

Updated View as Markdown

Connect a compatible CDP client to the connectUrl returned by a running Tooluse.net session. Use Chromium’s Page.captureScreenshot to capture that page. There is no separate native screenshot HTTP endpoint.

// client is an already connected, page-scoped CDP session.
const {data} = await client.send("Page.captureScreenshot", {
  format: "png", captureBeyondViewport: true
});
await writeFile("screenshot.png", Buffer.from(data, "base64"));

Import writeFile from node:fs/promises in a Node.js program. The image is returned to your automation process; it is not automatically added to retained browser downloads.

See Create a browser session and the Browsers API for authentication, request fields, and limits.

Type to search…

↑↓ navigate↵ selectEsc close