Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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),