diff --git a/packages/playwright-core/src/server/webkit/wkPage.ts b/packages/playwright-core/src/server/webkit/wkPage.ts index cfb3506dc9..c4cf4059b8 100644 --- a/packages/playwright-core/src/server/webkit/wkPage.ts +++ b/packages/playwright-core/src/server/webkit/wkPage.ts @@ -379,7 +379,7 @@ export class WKPage implements PageDelegate { eventsHelper.addEventListener(this._session, 'Page.frameDetached', event => this._onFrameDetached(event.frameId)), eventsHelper.addEventListener(this._session, 'Page.willCheckNavigationPolicy', event => this._onWillCheckNavigationPolicy(event.frameId)), eventsHelper.addEventListener(this._session, 'Page.didCheckNavigationPolicy', event => this._onDidCheckNavigationPolicy(event.frameId, event.cancel)), - eventsHelper.addEventListener(this._session, 'Page.frameScheduledNavigation', event => this._onFrameScheduledNavigation(event.frameId)), + eventsHelper.addEventListener(this._session, 'Page.frameScheduledNavigation', event => this._onFrameScheduledNavigation(event.frameId, event.delay, event.targetIsCurrentFrame)), eventsHelper.addEventListener(this._session, 'Page.loadEventFired', event => this._page._frameManager.frameLifecycleEvent(event.frameId, 'load')), eventsHelper.addEventListener(this._session, 'Page.domContentEventFired', event => this._page._frameManager.frameLifecycleEvent(event.frameId, 'domcontentloaded')), eventsHelper.addEventListener(this._session, 'Runtime.executionContextCreated', event => this._onExecutionContextCreated(event.context)), @@ -445,8 +445,9 @@ export class WKPage implements PageDelegate { this._page._frameManager.frameAbortedNavigation(frameId, 'Navigation canceled by policy check'); } - private _onFrameScheduledNavigation(frameId: string) { - this._page._frameManager.frameRequestedNavigation(frameId); + private _onFrameScheduledNavigation(frameId: string, delay: number, targetIsCurrentFrame: boolean) { + if (targetIsCurrentFrame) + this._page._frameManager.frameRequestedNavigation(frameId); } private _handleFrameTree(frameTree: Protocol.Page.FrameResourceTree) { diff --git a/tests/page/page-navigation.spec.ts b/tests/page/page-navigation.spec.ts index eb85adad01..a4a0942b17 100644 --- a/tests/page/page-navigation.spec.ts +++ b/tests/page/page-navigation.spec.ts @@ -33,9 +33,8 @@ it('should work with cross-process _blank target', async ({ page, server }) => { await page.click('"Click me"'); }); -it('should work with _blank target in form', async ({ page, server, browserName }) => { +it('should work with _blank target in form', async ({ page, server }) => { it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/18392' }); - it.fixme(browserName === 'webkit'); server.setRoute('/done.html?', (req, res) => { res.end(`Done`); });