October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

How to Capture Beyond the Viewport with Puppeteer and Chrome DevTools Protocol

Use Puppeteer’s fullPage option for ordinary full-page captures, or call CDP Page.captureScreenshot when you need explicit clip and protocol controls. Learn the option differences, prepare lazy-loaded pages, and troubleshoot common failures.

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.

For a conventional full-page screenshot, use Puppeteer’s page.screenshot({ fullPage: true }). Reach for Chrome DevTools Protocol (CDP) directly when you need to specify a precise clip or set protocol-level capture options. These are related but distinct controls: fullPage is Puppeteer’s high-level full-page request, clip selects a rectangle, and captureBeyondViewport controls capture beyond the visible viewport.

Capture a full page with Puppeteer

Puppeteer’s documented page-capture entry point is Page.screenshot(). Set fullPage: true to request the full page:

As an Amazon Associate I earn from qualifying purchases.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.goto('https://example.com', { waitUntil: 'networkidle2' });
  await page.screenshot({ path: 'full-page.png', fullPage: true });
} finally {
  await browser.close();
}

Save this as an ES module, for example capture.mjs, in a project where Puppeteer is installed, then run node capture.mjs. The output path is relative to the working directory. The example uses networkidle2, a wait condition shown in Puppeteer’s guide; it is not a guarantee that lazy images or every asynchronously changing element has finished rendering.

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

Puppeteer’s screenshot options also include clip and captureBeyondViewport. The documented defaults are fullPage: false and captureBeyondViewport: false when there is no clip, and true for captureBeyondViewport when a clip is supplied. For an ordinary full-page request, prefer the explicit fullPage: true option rather than treating the lower-level flag as a synonym.

#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

Use CDP when you need a clip or protocol-level control

Puppeteer can create a Chrome DevTools Protocol session attached to a page. Send Page.captureScreenshot through that session when you want to set the protocol’s options explicitly:

const client = await page.createCDPSession();
const { data } = await client.send('Page.captureScreenshot', {
  format: 'png',
  captureBeyondViewport: true,
  // Optional clip, in device-independent pixels:
  // clip: { x: 0, y: 0, width: 1280, height: 2400, scale: 1 },
});

// CDP returns the image as a base64-encoded string.
const image = Buffer.from(data, 'base64');
await import('node:fs/promises').then(({ writeFile }) =>
  writeFile('cdp-shot.png', image)
);

This snippet assumes page is an already-created Puppeteer page and the page has been navigated and prepared for capture. The returned data is base64-encoded image data; decoding it produces the PNG bytes written to disk.

What the clip coordinates mean

A CDP clip has x, y, width, height, and scale values. The protocol defines the rectangle in device-independent pixels. Set those coordinates to the region you actually want; a clip is not automatically a request for the entire document height. For example, the sample rectangle begins at the top-left coordinate and requests a 1280-by-2400 DIP region at scale 1.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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

Available CDP capture controls

  • format selects jpeg, png, or webp.
  • quality controls JPEG quality.
  • clip requests a specific rectangular region.
  • captureBeyondViewport controls whether capture can include content beyond the viewport. CDP documents its default as false; set it explicitly when that behavior matters.
  • fromSurface and optimizeForSpeed provide further protocol-level controls.

Direct CDP returns base64 data rather than writing a file for you, so decode and save it in your application. It is Chrome-specific in this context; check the protocol supported by the browser and version you deploy.

Choose between Puppeteer and direct CDP

Approach Use it when Controls Trade-off
Puppeteer Page.screenshot() You need a conventional full-page or element screenshot. fullPage, clip, output path, and format options. Less protocol plumbing; Puppeteer handles the higher-level screenshot call.
CDP Page.captureScreenshot through CDPSession You need explicit protocol settings or a custom clip. captureBeyondViewport, clip, format, quality, surface, and speed options. More direct control, with closer dependence on CDP details and target Chrome support.

For a specific DOM element rather than a full document, use Puppeteer’s ElementHandle.screenshot(). It scrolls the element into view if needed and then uses the page screenshot mechanism; it is not a substitute for capturing the entire page.

Prepare the page before capture

A full-page option describes the requested screenshot, not whether all page content is ready. Pages may load images only as they approach the viewport, append content during scrolling, animate, or update after navigation. Before capture:

Rank #3
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.
  • Trigger the page’s own loading behavior for content below the fold, such as scrolling through relevant sections when appropriate.
  • Wait for the specific content you need, and verify it is present before taking the screenshot.
  • If the page changes while capture is running, the image may reflect that change. Freezing animations, loading offscreen assets, or stitching multiple viewport captures are optional approaches that need testing for your page and browser.

Neither the Puppeteer options nor the CDP clip definition establishes that every page can be captured in one image at unlimited height. Large or unusual documents may need a different capture strategy, and behavior should be checked against the Chrome version in use.

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

Troubleshoot common capture problems

  • The image stops at the viewport: For Puppeteer, confirm you used fullPage: true and are calling page.screenshot(). For raw CDP, set captureBeyondViewport: true explicitly if the capture needs to extend past the viewport.
  • The crop is wrong or empty: Recheck the clip’s x, y, width, height, and scale. These are region coordinates in device-independent pixels, not an automatic full-document measurement.
  • Images or sections are missing: The navigation wait condition may have resolved before lazy or asynchronous content appeared. Trigger the page’s loading behavior and wait for the target content, then confirm it is present before capture.
  • The CDP command is rejected or behaves differently: Confirm that the browser target supports the command and options you are sending. The CDP “tot” reference changes over time, so verify against documentation for the Chrome release you run.
  • The output file is not a usable image: With direct CDP, decode the returned base64 data before saving it. The Puppeteer example instead writes the screenshot to the supplied path.

Or skip the browser setup

If you need a screenshot API rather than managing a browser, ScreenshotNeo returns a screenshot or PDF from one GET request. Its options include full-page capture with lazy images loaded, selector-based element capture, and custom viewport settings. For this Puppeteer/CDP task, it offers a hosted alternative; it does not change how the browser APIs work.

For example, save this as shot.webp using your API key and a target URL:

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • 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
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie and consent banners are accepted before capture and 60+ known consent platforms, newsletter popups, and chat widgets are removed; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Version and compatibility notes

The Puppeteer documentation consulted identifies version 25.12.0. The CDP protocol reference at Page.captureScreenshot is a moving “tot” reference, not a guarantee for every deployed Chrome release. Check the documentation for your installed Puppeteer and target browser before relying on option names, defaults, or compatibility details.

Frequently Asked Questions

Can I use Puppeteer’s full-page option and a clip together?

The APIs expose both options, but their interaction should be checked for the Puppeteer and Chrome versions you run; use one capture mode that clearly matches the region you need.

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.

Does a full-page screenshot include content on an infinite-scroll page?

Not necessarily. Content that has not been loaded or rendered before capture may be absent; trigger the page’s loading behavior and verify the required content first.

Is CDP’s “tot” documentation version-specific?

No. It is a moving protocol reference, so compare it with the protocol supported by your deployed Chrome version.

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

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.