DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon 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 Tracing Options: What They Do and How to Use Them

Puppeteer tracing records page activity between start and stop. Learn how bufferSize, categories, path and screenshots shape a trace, with examples for file and in-memory output.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puppeteer’s page.tracing API records activity for the current page. Start a trace with the options you need, perform the actions you want to inspect, then call page.tracing.stop(). The four documented options are bufferSize, categories, path and screenshots. Only one trace can be active per browser.

What the Puppeteer tracing options do

The options configure the trace buffer, the event categories collected, where output is saved, and whether screenshots are captured in the trace. The Puppeteer TracingOptions reference documents these settings.

As an Amazon Associate I earn from qualifying purchases.

Option What it controls When to use it
bufferSize Trace buffer size in kilobytes. If omitted or set to zero, the reference says Chromium’s default is 200 MB (200,000 KB). Change it only when you have a specific reason to adjust the buffer. It is not a promise about the final trace file’s size.
categories An array of tracing category strings to include or exclude. Use it to focus the trace on relevant event categories. Prefix a category with a hyphen to exclude it, for example -toplevel. If omitted, Puppeteer uses the categories in its implementation; check the implementation for the defaults in the version you use.
path A file path for writing the trace to disk. Set it when you want a trace file you can open or share. Omit it to retrieve trace data from stop() instead.
screenshots Whether screenshots are captured in the trace. The default is false. Set it to true when visual snapshots will help explain the timeline. The API reference does not quantify the resulting overhead or trace-size increase.

Record a trace to a file

This minimal example records navigation to a file named trace.json. Choose actions representative of the behavior you are investigating; a trace only helps explain what happens during the interval between starting and stopping it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const browser = await puppeteer.launch();
const page = await browser.newPage();

await page.tracing.start({
  path: 'trace.json',
  screenshots: true,
});

await page.goto('https://example.com');

await page.tracing.stop();
await browser.close();

The Puppeteer Page tracing reference documents the start-and-stop workflow. You can inspect the resulting trace in Chrome DevTools or a timeline viewer.

Choose file output or an in-memory trace

Use path when you want Puppeteer to write the trace to disk. Without path, the trace is not written to a file; stop() can instead return the trace data as a Uint8Array.

await page.tracing.start({ screenshots: false });
await page.goto('https://example.com');

const trace = await page.tracing.stop();
// trace is trace data as a Uint8Array when returned.

The documented return type is Promise<Uint8Array | undefined>, so handle the possibility that the result is undefined. See the Puppeteer tracing stop reference.

Set categories and buffer size deliberately

Categories

Provide an array of category strings when you want to select or exclude events. A leading hyphen marks an excluded category, as in -toplevel. The categories used when the option is omitted come from Puppeteer’s implementation, so do not assume a particular default list across versions; consult the implementation for the version installed in your project.

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.

Buffer size

The dedicated options reference reports that omitting bufferSize or setting it to zero uses Chromium’s default trace-buffer size of 200 MB (200,000 KB). This is Chromium’s buffer default as reported by the Puppeteer TracingOptions reference, version 25.12.0—not a recommendation or an output-file size guarantee.

Respect the one-trace-per-browser limit

Only one trace can be active at a time per browser, even when that browser has multiple pages. Complete or stop the active trace before starting another in the same browser. Puppeteer states this limit in its Tracing.start reference and Tracing reference.

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 your goal is simply to capture a website rather than inspect a Puppeteer trace, ScreenshotNeo provides a screenshot API and MCP server for developers. Its one-request call can return an image or PDF without setting up a browser script:

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, newsletter popups and chat widgets are removed before capture; bot checks, blank pages and failed loads are not billed. AI agents can take screenshots through its MCP server. The Free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000 shots. Sign up for free.

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

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. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

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.