mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix: do not hang on submitting target=_blank form (#20458)
Fixes #18392
This commit is contained in:
parent
e6f83f5b94
commit
cffe7b65e3
@ -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) {
|
||||
|
@ -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`);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user