A Puppeteer CoverageEntry describes one stylesheet or script in a coverage report. It contains the resource’s full text, a URL, and ranges marking portions of that text reported as covered. JavaScript reports use the more specific JSCoverageEntry type, which can also include raw V8 coverage data.
What a CoverageEntry contains
The base CoverageEntry interface has three properties:
| Property | What it represents |
|---|---|
ranges |
An array of { start, end } positions identifying covered portions of the resource text. |
text |
The stylesheet or script content associated with the entry. |
url |
The stylesheet or script URL. |
The range positions refer to locations in text. They are not source-map objects, and the entry does not itself provide a ready-calculated coverage percentage.
How JavaScript and CSS coverage reports differ
Puppeteer’s Coverage API can collect JavaScript and CSS usage information. The corresponding reports are arrays of entries; JavaScript entries use JSCoverageEntry, which extends CoverageEntry and may include rawScriptCoverage, the raw V8 script coverage entry. See the JSCoverageEntry reference.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errors#1 Best Overall
The official example starts coverage, exercises or navigates the page, then stops collection. It combines the JavaScript and CSS report arrays, totals resource text lengths, and sums range lengths using end - start - 1 to estimate used bytes. A percentage must be calculated from those totals; it is not a field on each entry. The Coverage class documentation shows this pattern.
What stopJSCoverage() returns
stopJSCoverage() returns an array of JavaScript coverage entries. Anonymous scripts are omitted by default. These include dynamically created scripts without an associated URL, such as scripts created with eval or new Function. If anonymous scripts are included, Puppeteer reports them using a debugger://VM URL unless a //# sourceURL comment provides another name.
Rank #2
Collection options that affect entries
Coverage options change what Puppeteer collects, not the three base fields of a CoverageEntry. The documented JavaScript options include:
- Granularity: JavaScript coverage defaults to block-level collection; function-level collection is another documented choice.
- Anonymous scripts: Omitted by default; an option can include them.
- Raw V8 data: Not included by default; an option can request it.
- Navigation reset: Coverage resets on navigation by default.
Refer to the JSCoverageOptions reference for the option names and current API details.
Rank #3
Navigation and preserving coverage
Setting resetOnNavigation to false does not guarantee coverage will survive navigation: Chrome may discard the previous page’s execution environment and its coverage data. When collecting across pages, stop coverage before leaving a page, start a new collection for the next page, and merge the resulting reports if that is appropriate for your analysis. The navigation caveat is documented in the JavaScript coverage options.
Turn coverage reports into Istanbul format
Puppeteer’s Coverage class documentation points to puppeteer-to-istanbul for converting coverage output into a format Istanbul can consume. This is useful when the next step in a test or reporting workflow expects Istanbul-compatible coverage rather than Puppeteer’s range-based entries.
Rank #4
Or skip the browser setup: capture a page screenshot
Coverage reports show which code ranges ran; they do not create a visual record of the page. If your task is to capture the rendered page, ScreenshotNeo provides a one-request screenshot API rather than a Puppeteer browser-setup workflow. For API parameters and options, see the ScreenshotNeo documentation.
For example, save a rendered page as WebP with cURL:
Quick Recap
Best Value
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not 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. Sign up for the free plan.
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.




