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

Puppeteer JavaScript coverage tells you which source ranges were observed during a particular browser run. To read it, inspect each entry’s script URL, source text, and covered ranges; then, if you need an aggregate, use Puppeteer’s documented range-length calculation. Treat the resulting percentage as a summary of that collection window—not as a score for test quality or overall feature coverage.

What Puppeteer JavaScript coverage contains

Coverage is a report about code observed while collection was active. A JavaScript coverage entry includes:

  • url: the script’s URL, useful for identifying the source.
  • text: the script source text against which the reported positions apply.
  • ranges: covered source ranges, each with numeric start and end offsets.

Use the entry’s own text when interpreting its offsets, and keep the matching source version if you generate an annotated report. JavaScript entries can also include rawScriptCoverage when raw V8 coverage is enabled. See Puppeteer’s CoverageEntry interface and JSCoverageEntry interface.

Start and stop coverage around the behavior you want to measure

Begin collection before the navigation or interaction sequence of interest. Exercise the page behavior you want represented, then stop collection and inspect the returned entries. Code run before collection starts or in an excluded category should not be assumed to appear.

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.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
const coverage = await page.coverage();
await coverage.startJSCoverage();

await page.goto('https://example.com');
// Perform the interactions whose code you want to observe.

const jsCoverage = await coverage.stopJSCoverage();
console.log(jsCoverage);

This follows Puppeteer’s coverage guide, which starts collection before navigation and stops it afterward. Consult the API reference for the Puppeteer version installed in your project: documentation pages may carry different version labels, and defaults can be version-sensitive. The current startJSCoverage() reference lists the options and defaults.

Calculate the documented aggregate percentage

Puppeteer’s example totals source-text lengths and covered range lengths, then divides the covered total by the total text length. For a JavaScript-only figure, apply that calculation to the JavaScript result array:

let totalBytes = 0;
let usedBytes = 0;

for (const entry of jsCoverage) {
  totalBytes += entry.text.length;
  for (const range of entry.ranges) {
    usedBytes += range.end - range.start - 1;
  }
}

const percentage = totalBytes === 0 ? 0 : (usedBytes / totalBytes) * 100;
console.log(`${percentage.toFixed(2)}%`);

The zero-total guard avoids dividing by zero if the returned report contains no source text. The range expression and denominator above reproduce Puppeteer’s documented example. Although the example calls the totals bytes, entry.text.length is a JavaScript string length; describe the result as the example’s aggregate range-to-text ratio rather than a count of statements, tests, or features. Puppeteer’s guide demonstrates combining JavaScript and CSS entries; do that only when you label the result as a combined JS/CSS ratio. The formula is in the official coverage guide.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Understand what can change the report

Block-level or function-level granularity

useBlockCoverage defaults to true in the current options reference, producing block-level coverage. Set it to false for function-level collection. Granularity changes where ranges are recorded, so keep it consistent when comparing runs. See JSCoverageOptions.

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

Anonymous scripts

The current startJSCoverage() reference lists reportAnonymousScripts: false by default. Anonymous scripts can include code created by eval or new Function. If reported, they may appear with URLs beginning debugger://VM; adding a //# sourceURL=... comment can give a dynamically created script a recognizable URL. Puppeteer’s stopJSCoverage() reference likewise notes that anonymous scripts are not included by default.

Raw V8 coverage

includeRawScriptCoverage defaults to false in the current start reference. Enable it when your workflow needs the raw V8 data exposed as the optional rawScriptCoverage field; it is separate from the ordinary URL, text, and ranges used in the documented aggregate.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Navigation and lost data

resetOnNavigation defaults to true. Setting it to false does not guarantee that earlier coverage survives navigation: Chrome can discard the old page execution environment and its coverage. To preserve reports reliably across pages, stop collection before navigating, start it again on the next page, and merge the separate reports yourself. This caveat is documented in JSCoverageOptions.

Compare runs on the same basis

A change in percentage is only interpretable when the measurement setup is comparable. Align these items before drawing conclusions:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Collection window: use the same navigation, user actions, and start/stop points.
  • Script population: compare the same script URLs and use the same anonymous-script setting.
  • Granularity and options: keep block/function coverage and raw-coverage configuration consistent.
  • Navigation strategy: use the same per-page stop, restart, and merge approach.
  • Denominator: use the same source text and state whether the figure covers JavaScript only or JavaScript plus CSS.

Even when all of these match, the percentage describes only the ranges returned for those collected scripts and exercised behaviors. It does not prove that every feature or user journey was tested.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common interpretation problems

The percentage is unexpectedly low

  • Check that collection began before the page behavior being measured.
  • Confirm that the test actually performed the interactions that execute the relevant code.
  • Check whether scripts you expected are anonymous and therefore excluded by the default setting.
  • Verify that you calculated against the intended population—JavaScript entries alone, or a clearly labeled JavaScript-and-CSS combination.

Ranges do not line up with the source you have

Offsets are meaningful against the text in that coverage entry. Do not annotate a different deployed or transformed file as though it were the same source; preserve the exact matching source version for interpretation.

Coverage disappears after navigation

Do not rely on resetOnNavigation: false as a preservation guarantee. Stop before navigating, start collection again on the next page, and merge the reports.

A run-to-run percentage changed without an obvious code change

Compare the collection window, script URLs, anonymous-script setting, granularity, navigation handling, and denominator. Any of these can alter the reported ranges or the total source text.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Or skip the browser setup

For screenshot capture rather than code-coverage instrumentation, ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF; its clean-shot options accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before capture. Each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the outcome in X-Page-Verdict and X-Billed headers. AI agents can use its MCP server tools, including take_screenshot, get_page_info, and capture_pdf.

Example cURL call (see the ScreenshotNeo documentation):

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

The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up free for ScreenshotNeo.

Frequently Asked Questions

Does a higher Puppeteer coverage percentage prove my tests are better?

No. It summarizes observed ranges for the scripts and behavior captured in that run; it does not establish test quality or complete feature coverage.

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.

Can I use this formula to count covered statements?

No. It calculates a ratio from source-text length and covered range lengths, not a statement count.

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.