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 →Call await page.coverage.stopCSSCoverage() after the navigation and interactions you want to measure. It returns an array of stylesheet coverage entries; it does not remove CSS or decide what is safe to delete.
Stop CSS coverage after the page activity you want to measure
Start coverage before navigating, exercise the page states that matter, then stop it and inspect the returned entries:
As an Amazon Associate I earn from qualifying purchases.
const page = await browser.newPage();
await page.coverage.startCSSCoverage();
await page.goto('https://example.com');
// Perform the interactions you want included in this capture.
const entries = await page.coverage.stopCSSCoverage();
for (const entry of entries) {
console.log(entry.url, entry.ranges);
}
The stop call is page.coverage.stopCSSCoverage(). Puppeteer’s Coverage.stopCSSCoverage() API documentation describes the result as coverage entries for stylesheets. Puppeteer’s Coverage class guide shows the lifecycle: start coverage, navigate, stop coverage, then process the entries. Use the public page API rather than constructing the Coverage class directly; its constructor is marked internal.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
What the returned entries tell you
Each entry contains stylesheet information, including its URL, text, and ranges identified as used during the captured run. These are observations from the page states and interactions exercised while coverage was active, not a site-wide inventory or a ready-made CSS-removal plan.
#1 Best Overall
Puppeteer’s class guide demonstrates estimating a used-byte percentage by summing each entry’s text length for the total and the lengths of its ranges for the used portion:
const totalBytes = entries.reduce((sum, entry) => sum + entry.text.length, 0);
const usedBytes = entries.reduce(
(sum, entry) => sum + entry.ranges.reduce(
(rangeSum, range) => rangeSum + range.end - range.start - 1,
0
),
0
);
const usedPercent = totalBytes === 0 ? 0 : (usedBytes / totalBytes) * 100;
console.log(`Used CSS in this run: ${usedPercent.toFixed(1)}%`);
This is an illustrative calculation over the captured entries, not a benchmark or proof that the remaining CSS can be deleted. Before removing styles, repeat coverage across relevant routes, responsive layouts, menus, dialogs, and other UI states, then validate the change against those states.
Rank #2
Navigation behavior and a documented limitation
The startCSSCoverage() API documentation lists resetOnNavigation with a default of true. If your measurement depends on how coverage behaves across navigation, set the option deliberately and verify it against the documentation for your installed Puppeteer version.
Puppeteer documents this limitation for CSS coverage: “CSS Coverage doesn’t include dynamically injected style tags without sourceURLs.” See the stopCSSCoverage() documentation. A report that omits injected styles may therefore reflect this documented limitation rather than a failure to stop coverage.
Rank #3
Troubleshooting
- The call fails because coverage was not started: call and await
page.coverage.startCSSCoverage()on that page before collecting coverage. - The entries miss styles used after initial load: keep coverage active while performing the interactions that use those styles, then stop it afterward.
- Injected styles are missing: Puppeteer documents that dynamically injected style tags without sourceURLs are not included in CSS coverage.
- The result seems to reset at navigation: check the
resetOnNavigationsetting and the documentation matching your installed version; the documented default istrue. - You expected unused CSS to be deleted: stopping coverage returns data to inspect. It does not modify stylesheets; deletion and validation are separate steps.
Or skip the browser setup
If your goal is a clean screenshot rather than CSS coverage, ScreenshotNeo can capture a page with one API request. It is not a replacement for Puppeteer’s coverage data and does not identify unused CSS.
See the ScreenshotNeo API documentation. For example, this cURL request saves a WebP screenshot of the target URL:
Rank #4
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
ScreenshotNeo removes cookie banners, newsletter 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 the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallSign up for ScreenshotNeo’s free plan.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Frequently Asked Questions
Does stopCSSCoverage() include CSS from a dynamically injected style tag?
Not if the injected style tag has no sourceURL; Puppeteer’s stopCSSCoverage() documentation names this as a CSS coverage limitation.
Quick 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.




