diff --git a/experimental/puppeteer-firefox/lib/Page.js b/experimental/puppeteer-firefox/lib/Page.js index b9d079de5f4..e3bf288956b 100644 --- a/experimental/puppeteer-firefox/lib/Page.js +++ b/experimental/puppeteer-firefox/lib/Page.js @@ -549,8 +549,11 @@ class Page extends EventEmitter { return await this._frameManager.mainFrame().select(selector, ...values); } - async close() { - await this._session.send('Browser.closePage' ); + async close(options = {}) { + const { + runBeforeUnload = false, + } = options; + await this._session.send('Browser.closePage', { runBeforeUnload }); } async content() { diff --git a/experimental/puppeteer-firefox/misc/puppeteer.cfg b/experimental/puppeteer-firefox/misc/puppeteer.cfg index 234a5a325bc..2d886e401dc 100644 --- a/experimental/puppeteer-firefox/misc/puppeteer.cfg +++ b/experimental/puppeteer-firefox/misc/puppeteer.cfg @@ -104,7 +104,7 @@ pref("datareporting.policy.dataSubmissionPolicyAccepted", false); pref("datareporting.policy.dataSubmissionPolicyBypassNotification", true); // Automatically unload beforeunload alerts -pref("dom.disable_beforeunload", true); +pref("dom.disable_beforeunload", false); // Disable popup-blocker pref("dom.disable_open_during_load", false); diff --git a/experimental/puppeteer-firefox/package.json b/experimental/puppeteer-firefox/package.json index 4652ebb84b0..1dd4b3166c8 100644 --- a/experimental/puppeteer-firefox/package.json +++ b/experimental/puppeteer-firefox/package.json @@ -9,7 +9,7 @@ "node": ">=8.9.4" }, "puppeteer": { - "firefox_revision": "0647e24cc0b90c07c8ddb32e63ce333839329527" + "firefox_revision": "4ba5b441257d5938d032d09fc09e45ea9d8f2e3a" }, "scripts": { "install": "node install.js", diff --git a/test/assets/beforeunload.html b/test/assets/beforeunload.html index 6c3075b475e..3cef6763f39 100644 --- a/test/assets/beforeunload.html +++ b/test/assets/beforeunload.html @@ -1,5 +1,10 @@ +