How to use the puppeteer-core/lib/Page.Page function in puppeteer-core

To help you get started, we’ve selected a few puppeteer-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alixaxel / chrome-aws-lambda / source / puppeteer / lib / Page.js View on Github external
let Super = null;

try {
  Super = require('puppeteer/lib/Page').Page;
} catch (error) {
  Super = require('puppeteer-core/lib/Page').Page;
}

Super.prototype.clickAndWaitForNavigation = function (selector, options = null) {
  if (options == null) {
    options = {
      timeout: this._defaultNavigationTimeout,
      waitUntil: [
        'domcontentloaded',
        'load',
      ],
    };
  }

  let promises = [
    this.waitForNavigation(options),
    this.click(selector),