Skip to content

Commit

Permalink
fix(firefox): properly handle navigations (#27132)
Browse files Browse the repository at this point in the history
In firefox, the `frameRequestedNavigation` is coming from renderer and
thus can happen **after** the `Network.requestWillBeSent`, which is
dispatched from the browser process.

Fixes #24132
  • Loading branch information
aslushnikov authored Sep 19, 2023
1 parent 6b36a50 commit 94e272b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/playwright-core/src/server/frames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ export class FrameManager {
// Do not override request with undefined.
return;
}
frame.setPendingDocument({ documentId, request: undefined });

const request = documentId ? Array.from(frame._inflightRequests).find(request => request._documentId === documentId) : undefined;
frame.setPendingDocument({ documentId, request });
}

frameCommittedNewDocumentNavigation(frameId: string, url: string, name: string, documentId: string, initial: boolean) {
Expand Down

0 comments on commit 94e272b

Please sign in to comment.