The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →To keep Puppeteer’s CSS coverage collection from resetting on each navigation, pass { resetOnNavigation: false } to page.coverage.startCSSCoverage(). The documented default is true, which resets coverage on each navigation. The option controls that reset behavior; it does not establish a broader guarantee that coverage data will persist through every browser or page lifecycle event.
What CSSCoverageOptions configures
In Puppeteer’s 25.10.0 API reference, CSSCoverageOptions is the optional configuration object accepted by page.coverage.startCSSCoverage(options?). The reference lists one property: resetOnNavigation?: boolean.
| Setting | Documented behavior | Use it when |
|---|---|---|
true (default) |
Coverage resets on each navigation. | You want navigation to begin a fresh coverage collection window. |
false |
Coverage does not reset on every navigation. | You want to avoid a reset on navigation during the collection window. |
These descriptions reflect the Puppeteer 25.10.0 API documentation; check the API reference for the Puppeteer version installed in your project if behavior or types differ.
Configure CSS coverage across navigation
Start coverage before navigating, then stop it after the pages or interactions you want to include. startCSSCoverage() resolves to void; the entries are returned by stopCSSCoverage().
#1 Best Overall
await page.coverage.startCSSCoverage({ resetOnNavigation: false });
await page.goto('https://example.com');
// Navigate to other pages or perform interactions to include in the collection.
const cssCoverage = await page.coverage.stopCSSCoverage();
console.log(cssCoverage);
Omit the options object, or set resetOnNavigation: true, when each navigation should reset the collection. Setting it to false asks Puppeteer not to reset coverage on every navigation; it should not be read as a promise about data surviving every possible browser lifecycle event.
Estimate used CSS bytes from the returned entries
Puppeteer’s coverage example estimates the share of reported source text covered by ranges. Applied to CSS entries alone, this gives a byte-range estimate for the data returned by the coverage API, not a complete measurement of every style that affected the page.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
const totalBytes = cssCoverage.reduce(
(sum, entry) => sum + entry.text.length,
0,
);
const usedBytes = cssCoverage.reduce(
(sum, entry) => sum + entry.ranges.reduce(
(entrySum, range) => entrySum + range.end - range.start - 1,
0,
),
0,
);
const usedPercent = totalBytes === 0 ? 0 : (usedBytes / totalBytes) * 100;
console.log({ totalBytes, usedBytes, usedPercent });
The calculation sums each entry’s text length as total bytes and the reported covered-range lengths as used bytes. Treat the percentage as an estimate based on those coverage entries, not as proof that all runtime CSS was observed.
Coverage’s CSS blind spot
Puppeteer documents that CSS Coverage does not include dynamically injected style tags without sourceURLs. Those styles therefore will not appear in the returned coverage entries. Account for that limitation before using a report to remove supposedly unused CSS; in particular, the report is not a complete accounting of every runtime style.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesRank #3
Troubleshooting
- The report is empty or shorter than expected: Confirm that
startCSSCoverage()ran before the page activity you intend to measure and thatstopCSSCoverage()ran after it. Check whether the default reset-on-navigation behavior is appropriate for your collection window. - Styles visible in the page are missing: Dynamically injected style tags without
sourceURLs are an explicitly documented omission. The returned entries cannot be treated as a full inventory of those styles. - You need a new report after each page load: Use the default behavior,
resetOnNavigation: true, so navigation resets coverage.
Or skip the browser setup
ScreenshotNeo is a website screenshot API, not a CSS coverage collector, so it does not replace Puppeteer’s CSS coverage report. If you also need a screenshot of a page, its one-call API can capture it:
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. It removes cookie banners, popups and chat widgets before the shot; bot checks, blank pages and failed loads are never billed. Its MCP server lets AI agents take screenshots, and 1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Frequently Asked Questions
Can I use the same options object to configure JavaScript coverage?
No. CSSCoverageOptions applies to CSS coverage started through page.coverage.startCSSCoverage(); consult the JavaScript coverage API for its own options.
Rank #4
- 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
Can Puppeteer export coverage in an Istanbul-compatible format?
Puppeteer points to puppeteer-to-istanbul as a tool for producing output consumable by Istanbul.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Quick Recap
Best Value
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.




