Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon 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 NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Puppeteer Full-Page Screenshots Cut Off Sticky Headers: How to Fix It

A clipped sticky header may be a capture-options issue or a positioning artifact. Check Puppeteer’s full-page and clip settings, then diagnose resizing and stitching tradeoffs.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If a Puppeteer full-page screenshot clips, misplaces, or repeats a sticky header, first check what you asked the browser to capture: use fullPage: true for the document, inspect any clip and captureBeyondViewport settings, then investigate the header’s CSS positioning and any scroll-and-stitch logic. Full-page capture does not guarantee that fixed or sticky elements will appear where you expect them.

Choose the capture target first

For the whole document, Puppeteer documents fullPage: true as taking a screenshot of the full page. A minimal example is:

const screenshot = await page.screenshot({ fullPage: true });

If you need one particular element rather than the entire page, use ElementHandle.screenshot() instead:

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const header = await page.$('header');
if (!header) throw new Error('Header not found');
const screenshot = await header.screenshot();

Puppeteer’s screenshot guide says that, by default, ElementHandle.screenshot() tries to scroll a hidden element into view. That behavior serves an element-specific capture, not a full-document screenshot. See the Puppeteer screenshot guide.

Check the screenshot options and clip

captureBeyondViewport is separate from fullPage. The current Puppeteer ScreenshotOptions reference documents its default as false when there is no clip, and true when a clip is supplied. Inspect the options in the actual call rather than assuming a clipped capture behaves like a full-document one.

For a basic whole-page capture, start without a clip:

const screenshot = await page.screenshot({ fullPage: true });

If your application deliberately needs a clipped region, check that the clip’s coordinates and dimensions include the content you want, and decide explicitly whether content beyond the viewport should be captured:

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.
const screenshot = await page.screenshot({
  clip: { x: 0, y: 0, width: 1200, height: 800 },
  captureBeyondViewport: true
});

This example captures a specified rectangle; it is not a substitute for a full-document capture. Confirm the option behavior against the Puppeteer version used by your application.

Diagnose the sticky or fixed header

A full-page screenshot’s document coverage and a header’s on-screen position are different issues. A header styled with position: fixed remains tied to the viewport; a position: sticky element changes position as its containing scroll area moves. Either can behave unexpectedly when the capture changes the viewport or scrolls through the page.

  1. Inspect the header’s CSS. Check whether it is fixed or sticky, its containing element, and whether its expected position depends on scrolling.
  2. Check how the capture is assembled. If your code scrolls and stitches several screenshots, a fixed or sticky header can appear in multiple segments or at a different position than expected.
  3. Compare the capture with the page’s normal viewport. If you resize the viewport to fit the document, viewport-relative units and fixed or sticky positioning may produce a different layout.

Puppeteer issue #5080 documents historical clipping behavior associated with Chromium screenshot changes around Puppeteer v2.0.0. The discussion notes that earlier behavior could place fixed banners in the middle of some full-page screenshots. It also explains why viewport resizing can change layout and why scrolling and stitching can duplicate fixed or sticky elements while adding capture work. Use it to understand the class of issue, not as a statement that every current version behaves the same way.

Use resizing or stitching only when their tradeoffs fit

Resizing the viewport

Increasing the viewport height can be a workaround in some capture setups, but it changes the viewport the page renders into. CSS using viewport units and fixed or sticky elements may therefore appear differently. Compare the result with the layout you actually intend to capture before adopting this approach.

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

Scrolling and stitching

Capturing viewport-sized sections and joining them can expose content that a particular capture path misses, but fixed and sticky elements may recur across sections. Stitching also adds capture steps and processing. If you use it, account for repeated headers deliberately rather than assuming each segment represents a unique part of the document.

What to do with the historical Blink flag

A comment dated January 11, 2021, in the Puppeteer issue reports using the Chromium launch flag --blink-settings=mainFrameClipsContent=false to restore older behavior. This is a version-dependent historical report, not a documented Puppeteer screenshot option or a generally established current fix. The current ScreenshotOptions reference does not list it as a supported API setting. Verify it against the Puppeteer and Chromium versions you actually run before considering it; prefer the documented options and a capture strategy that matches your target.

Troubleshooting checklist

  • The entire lower page is missing: Confirm that the call uses fullPage: true when the goal is the whole document, and remove an unintended clip.
  • A clipped capture omits content outside its rectangle: Recheck the clip’s coordinates and dimensions. Review captureBeyondViewport; its documented default depends on whether a clip is supplied.
  • The header is in the wrong position: Inspect whether it is fixed or sticky and whether viewport resizing or scrolling changes its layout.
  • The header appears more than once: Check for a scroll-and-stitch implementation; fixed and sticky elements can recur in separately captured sections.
  • A suggested launch flag has no effect: Treat the 2021 comment as historical, confirm your browser and Puppeteer versions, and do not assume the flag is a supported current API fix.
  • You only need the header image: Capture the header element with ElementHandle.screenshot() rather than requesting a full-page screenshot.
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 is a website screenshot API and MCP server for developers. Its one-request API can return an image or PDF; its clean-shot steps accept cookie or consent banners and remove known consent platforms, newsletter popups, and chat widgets before capture, and each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; responses identify the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients. The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots. See ScreenshotNeo and its API documentation.

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

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

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.
Best Value
The SQL Programming Language: .
  • Used Book in Good Condition

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.