DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk3 min

Puppeteer CSS Coverage Options Explained

Puppeteer CSS coverage documents one option: resetOnNavigation. Here is what its default does, how to collect reports, and what the results can miss.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puppeteer’s CSS coverage API documents one option: resetOnNavigation. It defaults to true, resetting coverage on each navigation. Set it to false to disable that automatic reset, but do not treat the setting as a guarantee that coverage will persist across every navigation. These details are in the Puppeteer v25.12.0 API reference.

What CSS coverage options does Puppeteer support?

In the v25.12.0 API reference, CSS coverage has one optional setting, resetOnNavigation. Its default is true. When enabled, coverage resets on each navigation; set it to false to turn off that automatic reset behavior.

This is the full CSS-specific option set documented in that reference. Settings such as includeRawScriptCoverage, reportAnonymousScripts, and useBlockCoverage apply to JavaScript coverage, not CSS coverage.

Choose the navigation scope deliberately

  • Keep the default when you want results scoped to each navigation.
  • Use false when you want to disable automatic resets while exercising a multi-navigation flow. The reference does not guarantee that coverage will persist across navigations, so verify the behavior that matters in your own flow.

How to collect CSS coverage

Start collection through the page’s coverage object, exercise the page states you care about, and stop collection to receive stylesheet reports.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.coverage.startCSSCoverage({ resetOnNavigation: false });

// Exercise the pages and states you want represented.
await page.goto('https://example.com/next-page');

const cssCoverage = await page.coverage.stopCSSCoverage();
console.log(cssCoverage);

To use the default reset behavior, omit the options object or pass { resetOnNavigation: true }. The call sequence is documented by the startCSSCoverage API and the stopCSSCoverage API.

What the returned reports mean

stopCSSCoverage() resolves to an array of reports for stylesheets. Puppeteer’s official example derives observed used-byte totals by summing range.end - range.start - 1 for each range, then compares that with the stylesheet text length to compute a percentage. Such a percentage describes what the exercised run observed; it does not establish that the remaining CSS is universally unused.

Rank #2
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

Important blind spot: injected style tags

Puppeteer’s Coverage documentation states: “CSS Coverage doesn’t include dynamically injected style tags without sourceURLs.” If your application injects styles at runtime, coverage may omit those blocks unless they have source URLs. Exercise the relevant pages and states, and account for injected styles before removing CSS based on a report.

Troubleshooting CSS coverage

  • Results reset after navigation: This is the default when resetOnNavigation is omitted. Set it to false to disable the automatic reset, then test whether the resulting reports cover your flow as intended.
  • Expected injected CSS is missing: Dynamically injected style tags without sourceURLs are not included. Do not interpret their absence as proof the styles are unused.
  • Coverage appears to show CSS as unused: The report reflects the page states and interactions exercised during collection. Visit the states that use the styles before using the result to make cleanup decisions.
  • You are looking for other CSS settings: The v25.12.0 reference documents only resetOnNavigation for CSS coverage. The named options includeRawScriptCoverage, reportAnonymousScripts, and useBlockCoverage are JavaScript coverage options.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you need screenshots of pages rather than stylesheet coverage, ScreenshotNeo offers a one-request screenshot API. Its documented request can return a screenshot or PDF; this is a separate task from collecting Puppeteer CSS coverage.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
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
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 banners, popups and chat widgets are removed before the shot; bot checks, blank pages and failed loads are never billed. An MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for free.

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. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver 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.