class: ChromiumBrowser

Chromium-specific features including Tracing, service worker support, etc. You can use chromiumBrowser.startTracing and chromiumBrowser.stopTracing to create a trace file which can be opened in Chrome DevTools or timeline viewer.

  1. await browser.startTracing(page, {path: 'trace.json'});
  2. await page.goto('https://www.google.com');
  3. await browser.stopTracing();

chromiumBrowser.newBrowserCDPSession()

  • returns: <Promise<CDPSession>> Promise that resolves to the newly created browser session.

chromiumBrowser.startTracing([page, options])

  • page <Page> Optional, if specified, tracing includes screenshots of the given page.
  • options <Object>
    • path <string> A path to write the trace file to.
    • screenshots <boolean> captures screenshots in the trace.
    • categories <Array<string>> specify custom categories to use instead of default.
  • returns: <Promise>

Only one trace can be active at a time per browser.

chromiumBrowser.stopTracing()

  • returns: <Promise<Buffer>> Promise which resolves to buffer with trace data.