chore: clear pendingDocument() for the same-document navigation

WebKit notifies about a pending same-document navigation through
`Page.frameScheduledNavigation`, and committing it should clear
the `pendingDocument()`.
This commit is contained in:
Dmitry Gozman 2024-10-04 12:08:28 +01:00
parent 3c5967d4f5
commit 0064f788f1

View file

@ -248,6 +248,11 @@ export class FrameManager {
const frame = this._frames.get(frameId); const frame = this._frames.get(frameId);
if (!frame) if (!frame)
return; return;
const pending = frame.pendingDocument();
if (pending && pending.documentId === undefined && pending.request === undefined) {
// WebKit has notified about the same-document navigation being requested, so clear it.
frame.setPendingDocument(undefined);
}
frame._url = url; frame._url = url;
const navigationEvent: NavigationEvent = { url, name: frame._name, isPublic: true }; const navigationEvent: NavigationEvent = { url, name: frame._name, isPublic: true };
this._fireInternalFrameNavigation(frame, navigationEvent); this._fireInternalFrameNavigation(frame, navigationEvent);