playwright#ChromiumBrowserContext TypeScript Examples

The following examples show how to use playwright#ChromiumBrowserContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: metrics-chromium.ts    From bpmn-visualization-js with Apache License 2.0 5 votes vote down vote up
static async create(page: Page): Promise<ChromiumMetricsCollector> {
    const collector = new ChromiumMetricsCollector();
    collector.client = await (page.context() as ChromiumBrowserContext).newCDPSession(page);
    // https://github.com/puppeteer/puppeteer/blob/v7.0.4/src/common/Page.ts#L492
    await collector.client.send('Performance.enable');
    return collector;
  }