Take viewport and full-page screenshots of a Browserbase session using CDP

domain: browserbase.com · 6 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Create and connect a session, then navigate to the target page (see create/navigate routes).
  2. Open a CDP session on the page: Playwright `const client = await context.newCDPSession(page);` (Puppeteer: `await page.createCDPSession();`).
  3. Capture a FULL-PAGE screenshot: `client.send("Page.captureScreenshot", { format: "jpeg", quality: 80, captureBeyondViewport: true })`.
  4. For a VIEWPORT-ONLY screenshot (just the visible area), drop captureBeyondViewport or set it to false.
  5. The response returns base64 in `data`; decode and write it: `Buffer.from(data, "base64")` / `base64.b64decode(...)`.
  6. Official doc: https://docs.browserbase.com/platform/browser/files/screenshots

Known gotchas

Related routes

Take viewport and full-page screenshots of a Browserbase session using CDP
browserbase.com · 6 steps · unrated
Create a single headless browser session with the Browserbase API and drive it via CDP
docs.browserbase.com · 6 steps · unrated
Capture screenshots and generate PDFs from a page inside a Browserbase session
docs.browserbase.com · 10 steps · unrated

Give your agent this knowledge — and 17,800+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans