Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Chrome DevTools Protocol (CDP) Page.captureScreenshot with captureBeyondViewport: true, fromSurface: true, and no clip. Chromium then captures the page’s full rendered dimensions in one operation. The response contains base64-encoded image bytes; decode them and save the result with the matching extension.

This guide shows the complete workflow, runnable clients, readiness checks, output formats, size limits, troubleshooting, and a hosted alternative when you do not want to operate a browser.

What the full-page CDP request does

The Page domain’s screenshot method is:

{
  "id": 1,
  "method": "Page.captureScreenshot",
  "params": {
    "format": "png",
    "captureBeyondViewport": true,
    "fromSurface": true
  }
}

The successful response is shaped like this:

{"id":1,"result":{"data":"<base64 image bytes>"}}

Decode result.data as base64 and write the bytes to a file. Leave out clip; an omitted clip is what lets Chromium use its automatic full-page path. Adding a clip intentionally restricts the capture rectangle.

Why this is not a scroll-and-stitch script

When fromSurface and captureBeyondViewport are true and no clip is supplied, Chromium asks the renderer for the full page size, starts at the top-left coordinate, and captures beyond the current viewport in one protocol operation. It does not define a loop that scrolls and joins screenshots. The image still reflects the page state at the instant of capture, so dynamic content must be ready first.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

End-to-end workflow

  1. Start Chrome or Chromium with a CDP endpoint. Use a dedicated profile for automation rather than your everyday profile.
  2. Attach to the page target. Query the debugging endpoint and select the tab you intend to capture.
  3. Enable the Page domain if your client requires it.
  4. Navigate and wait for an application-specific ready condition. A load event alone does not guarantee that lazy images, web fonts, or late API rendering have finished.
  5. Call Page.captureScreenshot with the full-page parameters and no clip.
  6. Base64-decode the returned data and save it as .png, .jpg, or .webp, matching the requested format.
  7. Record reproducibility details: browser version, URL, viewport or emulation settings, and the readiness condition used.

Launch Chrome for CDP

On a local machine, start a separate headless instance with a remote debugging port. The exact executable path varies by operating system.

google-chrome 
  --headless=new 
  --remote-debugging-port=9222 
  --user-data-dir=/tmp/cdp-profile

On Windows, use the path to chrome.exe; on macOS, use the Chrome binary inside the application bundle. Keep the debugging port restricted to localhost unless you have explicitly secured remote access.

Find an available page target with cURL

CDP exposes a small HTTP discovery endpoint. This cURL request lists tabs and their WebSocket debugger URLs:

curl http://127.0.0.1:9222/json

Choose the object whose url is your target and pass its webSocketDebuggerUrl to a WebSocket client. If no page appears, Chrome was not started with remote debugging, the port is wrong, or the process is blocked by a firewall.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Runnable Node.js implementation

Install the WebSocket client once:

npm install ws

Save this as full-page-shot.mjs. It discovers the first page, navigates, waits for a marker selector, requests a PNG, and decodes the response.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
import fs from 'node:fs';
import WebSocket from 'ws';

const targetUrl = process.argv[2] || 'https://example.com';
const readySelector = process.argv[3] || 'body';

const targets = await fetch('http://127.0.0.1:9222/json').then(r => r.json());
const page = targets.find(t => t.type === 'page');
if (!page?.webSocketDebuggerUrl) throw new Error('No CDP page target found');

const ws = new WebSocket(page.webSocketDebuggerUrl);
let nextId = 0;
const pending = new Map();
ws.on('message', raw => {
  const msg = JSON.parse(raw.toString());
  if (msg.id && pending.has(msg.id)) {
    const { resolve, reject } = pending.get(msg.id);
    pending.delete(msg.id);
    msg.error ? reject(new Error(JSON.stringify(msg.error))) : resolve(msg.result);
  }
});
const call = (method, params = {}) => new Promise((resolve, reject) => {
  const id = ++nextId;
  pending.set(id, { resolve, reject });
  ws.send(JSON.stringify({ id, method, params }));
});
const sleep = ms => new Promise(r => setTimeout(r, ms));

await new Promise((resolve, reject) => {
  ws.once('open', resolve);
  ws.once('error', reject);
});
await call('Page.enable');
await call('Page.navigate', { url: targetUrl });
await sleep(1500); // Replace with a site-specific readiness check when possible.
await call('Runtime.evaluate', {
  expression: `document.querySelector(${JSON.stringify(readySelector)}) !== null`
});

const result = await call('Page.captureScreenshot', {
  format: 'png',
  captureBeyondViewport: true,
  fromSurface: true
});
fs.writeFileSync('page.png', Buffer.from(result.data, 'base64'));
ws.close();
console.log('Saved page.png');

Run it with node full-page-shot.mjs https://example.com main. Replace the fixed delay with a condition tied to your application, such as a DOM marker that is inserted after data and images are ready. For production code, also listen for navigation and runtime errors and add a timeout around every pending protocol call.

Runnable Python implementation

Install the WebSocket library:

python -m pip install websocket-client

This script discovers a target, enables the Page domain, navigates, waits briefly, captures a full PNG, and writes the decoded bytes.

import base64
import json
import time
import urllib.request
import websocket

URL = 'https://example.com'

targets = json.load(urllib.request.urlopen('http://127.0.0.1:9222/json'))
page = next(t for t in targets if t.get('type') == 'page')
ws = websocket.create_connection(page['webSocketDebuggerUrl'], timeout=30)
next_id = 0

def call(method, params=None):
    global next_id
    next_id += 1
    ws.send(json.dumps({'id': next_id, 'method': method, 'params': params or {}}))
    while True:
        message = json.loads(ws.recv())
        if message.get('id') == next_id:
            if 'error' in message:
                raise RuntimeError(message['error'])
            return message.get('result', {})

call('Page.enable')
call('Page.navigate', {'url': URL})
time.sleep(1.5)  # Prefer an application-specific readiness check.
result = call('Page.captureScreenshot', {
    'format': 'png',
    'captureBeyondViewport': True,
    'fromSurface': True
})
with open('page.png', 'wb') as output:
    output.write(base64.b64decode(result['data']))
ws.close()
print('Saved page.png')

The receive loop ignores asynchronous CDP events until the response with the matching request ID arrives. A production client should retain those events for navigation, console, and loading diagnostics.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choosing format, quality, and clipping

Setting Behavior When to use it
format: "png" Lossless output and the protocol default UI documentation, text, diagrams, and pixel-accurate comparisons
format: "jpeg" Lossy output with optional quality from 0 through 100 Photographic pages or smaller files where loss is acceptable
format: "webp" WebP output; the JPEG quality parameter does not apply Web delivery when your image pipeline accepts WebP
captureBeyondViewport: true Enables the full-page path when no clip is present Entire document captures
clip Limits capture to an explicit x, y, width, and height rectangle Sections, panels, or recovery from oversized documents
fromSurface: true Captures from the rendered surface; this is the path used by Chromium’s full-page branch Normal full-page captures

For JPEG, add for example "quality": 85. Quality is ignored for PNG and WebP. Do not combine an automatic full-page request with a clip unless you deliberately want a bounded rectangle.

Make the captured page deterministic

Wait for the application, not just navigation

Single-page applications may render after navigation completes. Wait for a known element, a data-complete flag, or a network-idle condition implemented by your own client. CDP does not promise one universal event that means every site’s lazy images, fonts, and late rendering are complete.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Control viewport and emulation

Set the same viewport, device scale factor, user agent, timezone, and geolocation for repeatable captures. A larger emulated scale increases the resulting pixel dimensions and can push a page toward Chromium’s size guard.

Handle lazy content

Full-page capture requests the full rendered surface, but it does not guarantee that application code has loaded every lazy resource. Trigger the site’s own loading behavior or scroll programmatically before the final readiness check when necessary.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Limits and failure handling

“Page is too large.”

Chromium rejects a full-page capture when either image dimension is at least 128 × 1024 pixels (131,072 pixels). This is an implementation guard, not a promise that every version behaves identically in all modes. For pages near the boundary:

  • Reduce emulated scale or viewport dimensions.
  • Capture logical sections with explicit clips.
  • Combine those section images in your own image-processing step.
  • Test against the exact Chrome or Chromium version deployed in production.

Capture stops at the viewport

Check that captureBeyondViewport is literally true, fromSurface is true, and clip is absent. Also verify that you are connected to the intended page target rather than a different tab or an extension page.

Blank, incomplete, or shifting output

  • Blank page: capture ran before navigation or application rendering finished; wait for a real readiness marker.
  • Missing images: lazy loading, blocked resources, or a late API response; trigger loading and wait for image completion.
  • Layout changes during capture: freeze animations where possible, wait for fonts and data, and capture only after layout has settled.
  • Protocol timeout: increase the client timeout for large pages and log the request ID, browser version, URL, and dimensions.

Inactive or unavailable target

A target can disappear when a tab closes, a browser restarts, or a context is recycled. Re-query /json, reconnect to the current page target, and retry navigation before retrying the screenshot. Avoid blindly repeating captures against a stale WebSocket.

Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Performance, reliability, and cost considerations

A full-page operation avoids the stitching artifacts and synchronization problems of a manual scroll loop, but memory use still grows with pixel dimensions and encoded output. PNG can be substantially larger than JPEG or WebP. Keep captures bounded when you only need a component, and use a clip for recurring panels.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For reliable automation, isolate browser profiles, cap concurrent captures, set navigation and protocol timeouts, record failures with the target URL and dimensions, and retry only transient target or loading failures. Treat the browser version as part of the capture environment because implementation limits and rendering behavior can change.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo provides a hosted screenshot API and MCP server. One GET request returns PNG, JPEG, WebP, or a PDF, while its capture process accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the shot. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and each response identifies the result with X-Page-Verdict and X-Billed headers.

For developers who use AI tooling, its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients. Features include full-page lazy-image loading, CSS-selector element capture, dark mode, device presets, retina scale, PDF controls, custom CSS and JavaScript, clicks, waits, blocking rules, headers, cookies, user agents, authorization, timezone and geolocation, transparent backgrounds, resizing, TTL caching, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification.

Use the same endpoint from the ScreenshotNeo documentation:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is included on every plan. Create a free ScreenshotNeo account to get started.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Practical checklist

  • Chrome is running with a reachable CDP endpoint.
  • You selected the correct page target.
  • The Page domain is enabled.
  • Navigation and application rendering are complete.
  • captureBeyondViewport and fromSurface are true.
  • clip is omitted for automatic full-page capture.
  • The output extension matches the requested format.
  • The document dimensions are below Chromium’s per-dimension guard.
  • The decoded bytes are written atomically and failures are logged.

Frequently Asked Questions

Can I use a clip and still capture the entire page?

No. A clip defines a bounded rectangle. Omit it for Chromium’s automatic full-page path, or use clips deliberately for section captures.

Does CDP wait for every image and web font automatically?

No universal readiness event covers every site. Wait for an application-specific marker or loading condition before calling Page.captureScreenshot.

Which format should I choose for visual regression tests?

PNG is the safest default because it is lossless. Use JPEG or WebP only when your comparison pipeline accepts their encoding differences.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What should I log to reproduce a failed capture?

Record the browser version, URL, target, viewport and scale settings, readiness condition, requested format, document dimensions, protocol error, and timing.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.