diff --git a/package.json b/package.json
index a5ac1ccb584d99..cbd89b3b3c9ac1 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
"playwright": {
"chromium_revision": "733125",
"firefox_revision": "1018",
- "webkit_revision": "1113"
+ "webkit_revision": "1118"
},
"scripts": {
"unit": "node test/test.js",
diff --git a/src/webkit/wkPageProxy.ts b/src/webkit/wkPageProxy.ts
index c1cda05b9632f7..05bb0adfcb012b 100644
--- a/src/webkit/wkPageProxy.ts
+++ b/src/webkit/wkPageProxy.ts
@@ -144,8 +144,12 @@ export class WKPageProxy {
(session as any)[isPovisionalSymbol] = true;
if (targetInfo.isProvisional && this._wkPage)
this._wkPage.onProvisionalLoadStarted(session);
- if (targetInfo.isPaused)
- this._pageProxySession.send('Target.resume', { targetId: targetInfo.targetId }).catch(debugError);
+ if (targetInfo.isPaused) {
+ if (targetInfo.isProvisional)
+ this._pageProxySession.send('Target.resume', { targetId: targetInfo.targetId }).catch(debugError);
+ else if (this._pagePromise)
+ this._pagePromise.then(() => this._pageProxySession.send('Target.resume', { targetId: targetInfo.targetId }).catch(debugError));
+ }
}
private _onTargetDestroyed(event: Protocol.Target.targetDestroyedPayload) {
diff --git a/test/page.spec.js b/test/page.spec.js
index 5c0bf4513dfd1c..aec88f670a36e5 100644
--- a/test/page.spec.js
+++ b/test/page.spec.js
@@ -154,7 +154,7 @@ module.exports.describe = function({testRunner, expect, headless, playwright, FF
await page.goto(server.EMPTY_PAGE);
await page.setContent('yo');
const [popup] = await Promise.all([
- page.waitForEvent('popup'),
+ page.waitForEvent('popup').then(async popup => { await popup.waitForLoadState(); return popup; }),
page.$eval('a', a => a.click()),
]);
expect(await page.evaluate(() => !!window.opener)).toBe(false);
@@ -166,13 +166,13 @@ module.exports.describe = function({testRunner, expect, headless, playwright, FF
await page.goto(server.EMPTY_PAGE);
await page.setContent('yo');
const [popup] = await Promise.all([
- new Promise(x => page.once('popup', x)),
+ page.waitForEvent('popup').then(async popup => { await popup.waitForLoadState(); return popup; }),
page.click('a'),
]);
expect(await page.evaluate(() => !!window.opener)).toBe(false);
expect(await popup.evaluate(() => !!window.opener)).toBe(false);
});
- it.skip(WEBKIT || FFOX)('should not treat navigations as new popups', async({page, server}) => {
+ it.skip(FFOX)('should not treat navigations as new popups', async({page, server}) => {
await page.goto(server.EMPTY_PAGE);
await page.setContent('yo');
const [popup] = await Promise.all([