Merge pull request #14321 from timvandermeij/puppeteer
Upgrade to Puppeteer 12
This commit is contained in:
commit
700eaecddd
20511
package-lock.json
generated
20511
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -41,7 +41,7 @@
|
||||
"postcss": "^8.4.4",
|
||||
"postcss-calc": "^8.0.0",
|
||||
"prettier": "^2.5.0",
|
||||
"puppeteer": "^10.4.0",
|
||||
"puppeteer": "^12.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"streamqueue": "^1.1.2",
|
||||
"stylelint": "^14.1.0",
|
||||
|
20
test/test.js
20
test/test.js
@ -24,8 +24,24 @@ var os = require("os");
|
||||
var puppeteer = require("puppeteer");
|
||||
var url = require("url");
|
||||
var testUtils = require("./testutils.js");
|
||||
const dns = require("dns");
|
||||
const yargs = require("yargs");
|
||||
|
||||
// Chrome uses host `127.0.0.1` in the browser's websocket endpoint URL while
|
||||
// Firefox uses `localhost`, which before Node.js 17 also resolved to the IPv4
|
||||
// address `127.0.0.1` by Node.js' DNS resolver. However, this behavior changed
|
||||
// in Node.js 17 where the default is to prefer an IPv6 address if one is
|
||||
// offered (which varies based on the OS and/or how the `localhost` hostname
|
||||
// resolution is configured), so it can now also resolve to `::1`. This causes
|
||||
// Firefox to not start anymore since it doesn't bind on the `::1` interface.
|
||||
// To avoid this, we switch Node.js' DNS resolver back to preferring IPv4
|
||||
// since we connect to a local browser anyway. Only do this for Node.js versions
|
||||
// that actually have this API since it got introduced in Node.js 14.18.0 and
|
||||
// it's not relevant for older versions anyway.
|
||||
if (dns.setDefaultResultOrder !== undefined) {
|
||||
dns.setDefaultResultOrder("ipv4first");
|
||||
}
|
||||
|
||||
function parseOptions() {
|
||||
yargs
|
||||
.usage("Usage: $0")
|
||||
@ -940,7 +956,7 @@ async function startBrowser(browserName, startUrl = "") {
|
||||
if (startUrl) {
|
||||
const pages = await browser.pages();
|
||||
const page = pages[0];
|
||||
await page.goto(startUrl, { timeout: 0 });
|
||||
await page.goto(startUrl, { timeout: 0, waitUntil: "domcontentloaded" });
|
||||
}
|
||||
|
||||
return browser;
|
||||
@ -975,7 +991,7 @@ function startBrowsers(initSessionCallback, makeStartUrl = null) {
|
||||
}
|
||||
})
|
||||
.catch(function (ex) {
|
||||
console.log(`Error while starting ${browserName}: ${ex}`);
|
||||
console.log(`Error while starting ${browserName}: ${ex.message}`);
|
||||
closeSession(browserName);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user