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
Chromium

How to Fix Puppeteer Full-Page Screenshots in Headful Mode

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

Use Puppeteer’s documented fullPage: true option for a full-document image. If a visible (headful) Chromium window flickers, resizes, or produces a viewport-sensitive layout, make the capture behavior explicit with captureBeyondViewport: false, then compare the result with a normal viewport capture. That setting solved one reported Puppeteer 8.0.0 case, but it is a workaround to test—not a guarantee for every release, browser, or site.

1. Capture the complete document

Launch Chromium with headless: false, set a deliberate viewport, wait for the page to settle, and request a full-page screenshot. The following CommonJS script is a complete starting point:

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    headless: false,
    defaultViewport: { width: 1440, height: 900 },
  });

  const page = await browser.newPage();
  await page.goto('https://example.com', { waitUntil: 'networkidle2' });
  await page.screenshot({
    path: 'page.png',
    fullPage: true,
  });

  await browser.close();
})();

fullPage: true means the requested image covers the page’s full document rather than only the currently visible viewport. It is different from selecting an element or supplying a clip rectangle.

Make the beyond-viewport behavior explicit

If the browser visibly blinks or changes size while capturing, try:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option
await page.screenshot({
  path: 'page.png',
  fullPage: true,
  captureBeyondViewport: false,
});

Puppeteer’s current reference describes captureBeyondViewport as controlling whether pixels outside the viewport are captured. Its default depends on the other options: with no clip it is false, and with a clip it is true. Setting it explicitly removes that ambiguity while you diagnose a headful capture.

A historical report filed against Puppeteer 8.0.0 says that setting this option to false stopped the reporter’s headful viewport flicker. Treat that as environment-specific troubleshooting evidence. It does not establish that all current Puppeteer versions have the same defect.

2. Use a deterministic headful setup

Headful mode adds a visible window, desktop compositor, and possible browser UI effects. Stabilize the inputs before changing screenshot flags.

Rank #2
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
  1. Pin and record versions. Log your Puppeteer package version and the Chromium or Chrome version it launches. The historical reports involve Puppeteer 8.0.0, 2.0.0, and older releases; current behavior may differ.
  2. Set the viewport before navigation. Use page.setViewportSize-equivalent configuration (the defaultViewport launch option or page.setViewport, depending on your Puppeteer version) before loading the URL.
  3. Keep the desktop window large enough. A small OS window can make responsive breakpoints change even when Puppeteer’s logical viewport is unchanged.
  4. Wait for content that affects page height. Use a suitable navigation condition, then wait for a known selector or application-ready signal when JavaScript adds content after navigation.
  5. Capture once the layout is stable. Avoid taking the image while animations, font swaps, lazy images, or client-side hydration are still changing dimensions.

Do not infer that a screenshot setting changed your site’s CSS until you compare the same URL, viewport, zoom level, user agent, and loaded state.

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

3. Diagnose layout changes instead of hiding them

Check viewport-relative CSS

Historical reports describe full-page captures that looked different from an ordinary viewport, especially with vh, vw, fixed positioning, and sticky elements. These units are intentionally tied to the viewport. A full-document operation can expose a difference between the visible viewport and the document’s total dimensions; that can make a hero section, modal, or fixed toolbar appear to move.

Inspect computed values in DevTools or temporarily log them:

const metrics = await page.evaluate(() => ({
  innerWidth: window.innerWidth,
  innerHeight: window.innerHeight,
  scrollWidth: document.documentElement.scrollWidth,
  scrollHeight: document.documentElement.scrollHeight,
  dpr: window.devicePixelRatio,
}));
console.log(metrics);

Compare these values immediately before a normal viewport screenshot and immediately before the full-page screenshot. If innerWidth or innerHeight changes, investigate the browser window, emulation settings, or capture mode. If only document dimensions grow, the difference may simply be content below the fold.

Distinguish capture types

Goal Use What it does not mean
Entire document fullPage: true Not an element or region clip
One region clip: { x, y, width, height } Not a full-document layout request
One element Get the element’s bounding box, then use a clip Not equivalent to fullPage
Viewport only Omit fullPage Does not include content below the fold

Keep the desired extent separate from the flicker fix. A clip can deliberately use beyond-viewport pixels, while a full-page request asks Puppeteer to cover the document; combining options without a clear goal makes results harder to interpret.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

4. A robust diagnostic script

This version saves both a normal viewport image and a full-page image with explicit beyond-viewport behavior, while printing dimensions for comparison:

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    headless: false,
    defaultViewport: { width: 1366, height: 768 },
  });
  const page = await browser.newPage();
  await page.goto('https://example.com', { waitUntil: 'networkidle2' });

  await page.screenshot({ path: 'viewport.png' });
  console.log('before full page', await page.evaluate(() => ({
    innerWidth: window.innerWidth,
    innerHeight: window.innerHeight,
    scrollHeight: document.documentElement.scrollHeight,
  })));

  await page.screenshot({
    path: 'full-page.png',
    fullPage: true,
    captureBeyondViewport: false,
  });

  console.log('after full page', await page.evaluate(() => ({
    innerWidth: window.innerWidth,
    innerHeight: window.innerHeight,
    scrollHeight: document.documentElement.scrollHeight,
  })));
  await browser.close();
})();

If the two dimension logs match but the rendering differs, inspect viewport-relative CSS, sticky/fixed elements, animation, fonts, and content that loads during capture. If the logs differ, reduce the problem to viewport configuration and browser version before changing page styles.

5. Common symptoms and fixes

The window visibly resizes or blinks

  • Set captureBeyondViewport: false together with fullPage: true.
  • Confirm the viewport is fixed before navigation and that the OS window is not being manually resized.
  • Try the same script in the exact Puppeteer and browser versions used in production; the documented option semantics and the old workaround report do not promise identical behavior across versions.

The full image has a different responsive layout

  • Check vh, vw, media queries, fixed headers, and sticky positioning.
  • Compare innerWidth, innerHeight, device pixel ratio, and user agent between captures.
  • Capture after fonts, images, hydration, and lazy content have completed.

The image stops before the bottom

  • Verify that the page actually has the expected scrollHeight.
  • Wait for infinite-scroll or lazy content before calling screenshot.
  • Check for an application shell whose scroll container is not document.documentElement; a full-document screenshot does not automatically mean every nested scrolling element is included.

An element moves only in the full-page image

Decide whether it is viewport-fixed, sticky, or positioned with viewport units. If you need one stable component rather than the whole document, capture that element with a measured clip instead of treating fullPage as an element-capture mode.

The script hangs or times out

  • Use a realistic navigation wait condition; pages with long-lived connections may never become fully idle.
  • Replace an overly strict network-idle wait with a specific ready selector and a bounded timeout.
  • Record whether the failure occurs during navigation, the readiness wait, or screenshot encoding.

6. Performance, reliability, and output choices

Full-page images can be much taller than the viewport. Memory and encoding time rise with pixel dimensions, device scale factor, and image format. Use PNG when lossless text and transparency matter; JPEG or WebP can reduce output size when your workflow permits compression. A large page may be more reliable when captured after removing unnecessary animations and waiting for only the content your deliverable requires.

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.

Do not claim that captureBeyondViewport: false is faster or slower without measuring your own pages. The available evidence documents option behavior and a historical symptom report, not a benchmark. For repeatable diagnosis, store the URL, Puppeteer version, browser version, viewport, device scale factor, relevant flags, and the two output files.

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

7. When to use an API instead of a visible browser

If you do not need to watch Chromium or debug a page interactively, a screenshot API removes browser-window setup from your code. ScreenshotNeo is the first alternative to try here: it cleans consent banners, newsletter popups, and chat widgets before capture, and bills only clean shots.

Or skip the browser setup

One GET request returns an image or PDF. The API supports PNG, JPEG, and WebP; full-page capture, element selectors, device presets, custom viewports, retina scale, waits, custom CSS and JavaScript, headers and cookies, blocking rules, caching, PDFs, bulk jobs, signed links, webhooks, and other controls. Each response identifies the page verdict and whether it was billed. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for the full parameter set.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
JavaScript and jQuery: Interactive Front-End Web Development
  • JavaScript Jquery
  • Introduces core programming concepts in JavaScript and jQuery
  • Uses clear descriptions, inspiring examples, and easy-to-follow diagrams
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots, and every feature is available on every plan. Create a free ScreenshotNeo account.

8. A practical decision checklist

  • Need a visible browser for debugging? Use headful Puppeteer and start with fullPage: true.
  • Seeing a resize or flicker? Add captureBeyondViewport: false and record versions.
  • Seeing layout drift? Compare viewport metrics and inspect vh, vw, fixed, and sticky styles.
  • Need a region or component? Use a clip based on its bounding box, not fullPage.
  • Need unattended, cleaned screenshots? Use an API and verify its response verdict and billing headers.

Frequently Asked Questions

Does headful mode require a different screenshot API?

No. The same page.screenshot options apply; headful mode changes how Chromium is displayed, so viewport and compositor effects need to be diagnosed.

Is captureBeyondViewport: false a permanent Puppeteer fix?

No. It is an explicit setting and a historically reported workaround. Validate it with your Puppeteer version, browser version, and page.

Can a full-page screenshot include content inside every nested scroll area?

Not automatically. Confirm which element owns scrolling; a document capture and a nested scroll-container capture are different workflows.

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

Quick Recap

SaleBestseller No. 1
HTML and CSS: Design and Build Websites
HTML and CSS: Design and Build Websites
HTML CSS Design and Build Web Sites; Comes with secure packaging; It can be a gift option
$14.18
SaleBestseller No. 2
Web Design with HTML, CSS, JavaScript and jQuery Set
Web Design with HTML, CSS, JavaScript and jQuery Set
Brand: Wiley; Set of 2 Volumes
$35.05
SaleBestseller No. 3
SaleBestseller No. 5
JavaScript and jQuery: Interactive Front-End Web Development
JavaScript and jQuery: Interactive Front-End Web Development
JavaScript Jquery; Introduces core programming concepts in JavaScript and jQuery; Uses clear descriptions, inspiring examples, and easy-to-follow diagrams
$22.80

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.

Read next

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

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.