|
@@ -23,7 +23,7 @@
|
|
|
|
|
|
|
|
/* global singlefile, require, exports */
|
|
/* global singlefile, require, exports */
|
|
|
|
|
|
|
|
-const puppeteer = require("puppeteer-firefox");
|
|
|
|
|
|
|
+const puppeteer = require("puppeteer-core");
|
|
|
const scripts = require("./common/scripts.js");
|
|
const scripts = require("./common/scripts.js");
|
|
|
|
|
|
|
|
const EXECUTION_CONTEXT_DESTROYED_ERROR = "Execution context was destroyed";
|
|
const EXECUTION_CONTEXT_DESTROYED_ERROR = "Execution context was destroyed";
|
|
@@ -63,6 +63,7 @@ function getBrowserOptions(options) {
|
|
|
if (options.browserExecutablePath) {
|
|
if (options.browserExecutablePath) {
|
|
|
browserOptions.executablePath = options.browserExecutablePath || "firefox";
|
|
browserOptions.executablePath = options.browserExecutablePath || "firefox";
|
|
|
}
|
|
}
|
|
|
|
|
+ browserOptions.product = "firefox";
|
|
|
return browserOptions;
|
|
return browserOptions;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -74,7 +75,11 @@ async function setPageOptions(page, options) {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
if ((options.browserBypassCSP === undefined || options.browserBypassCSP) && page.setBypassCSP) {
|
|
if ((options.browserBypassCSP === undefined || options.browserBypassCSP) && page.setBypassCSP) {
|
|
|
- await page.setBypassCSP(true);
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ await page.setBypassCSP(true);
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ // ignored
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|