fix(bidi): set initial frame url from creation event (#34198)

This commit is contained in:
Yury Semikhatsky 2025-01-03 10:39:32 -08:00 committed by GitHub
parent 6bdd2694ee
commit dca95ba609
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View file

@ -152,6 +152,9 @@ export class BidiBrowser extends Browser {
continue;
page._session.addFrameBrowsingContext(event.context);
page._page._frameManager.frameAttached(event.context, parentFrameId);
const frame = page._page._frameManager.frame(event.context);
if (frame)
frame._url = event.url;
return;
}
return;
@ -164,6 +167,7 @@ export class BidiBrowser extends Browser {
const session = this._connection.createMainFrameBrowsingContextSession(event.context);
const opener = event.originalOpener && this._bidiPages.get(event.originalOpener);
const page = new BidiPage(context, session, opener || null);
page._page.mainFrame()._url = event.url;
this._bidiPages.set(event.context, page);
}

View file

@ -310,7 +310,7 @@ library/browsercontext-network-event.spec.ts BrowserContext.Events.RequestFi
library/browsercontext-network-event.spec.ts BrowserContext.Events.Response [pass]
library/browsercontext-network-event.spec.ts should fire events in proper order [pass]
library/browsercontext-network-event.spec.ts should not fire events for favicon or favicon redirects [unknown]
library/browsercontext-page-event.spec.ts should fire page lifecycle events [fail]
library/browsercontext-page-event.spec.ts should fire page lifecycle events [pass]
library/browsercontext-page-event.spec.ts should have about:blank for empty url with domcontentloaded [fail]
library/browsercontext-page-event.spec.ts should have about:blank url with domcontentloaded [fail]
library/browsercontext-page-event.spec.ts should have an opener [pass]

View file

@ -312,7 +312,7 @@ library/browsercontext-network-event.spec.ts BrowserContext.Events.Response
library/browsercontext-network-event.spec.ts should fire events in proper order [pass]
library/browsercontext-network-event.spec.ts should not fire events for favicon or favicon redirects [unknown]
library/browsercontext-network-event.spec.ts should reject response.finished if context closes [timeout]
library/browsercontext-page-event.spec.ts should fire page lifecycle events [fail]
library/browsercontext-page-event.spec.ts should fire page lifecycle events [pass]
library/browsercontext-page-event.spec.ts should have about:blank for empty url with domcontentloaded [timeout]
library/browsercontext-page-event.spec.ts should have about:blank url with domcontentloaded [pass]
library/browsercontext-page-event.spec.ts should have an opener [pass]