fix(firefox): guard against missing location in uncaughtError protocol event#41173
Open
ottowainright wants to merge 2 commits into
Open
fix(firefox): guard against missing location in uncaughtError protocol event#41173ottowainright wants to merge 2 commits into
ottowainright wants to merge 2 commits into
Conversation
…l event Firefox can omit the location field in Page.uncaughtError events when an uncaught error fires during mid-navigation (e.g. interrupted by a WAF challenge). Reading pageError.location.url unconditionally crashes the driver process. - Make uncaughtErrorPayload.location optional in protocol.d.ts - Widen PageError.location and addPageError() to accept undefined - Use optional-chain + empty-string/zero fallbacks in the dispatcher and tracing recorder (consistent with Chromium's stackTraceToLocation) Fixes: microsoft#41169
…ify no crash Replace the weak end-to-end guard with a test that injects a synthetic Page.uncaughtError event with no location field directly into the Firefox protocol session. This exercises the exact code path that crashed before the fix and will fail on the unfixed code. Fixes: microsoft#41169
Author
|
@microsoft-github-policy-service agree |
yury-s
reviewed
Jun 5, 2026
| frameId: string; | ||
| message: string; | ||
| stack: string; | ||
| location: { |
Member
There was a problem hiding this comment.
this file is generated, it means that the bug is on the firefox end where it doesn't send the location and we should fix it there
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
locationinPage.uncaughtErrorprotocol events when an uncaught error fires during mid-navigation (e.g. interrupted by a WAF challenge), crashing the driver withTypeError: Cannot read properties of undefined (reading 'url')uncaughtErrorPayload.locationoptional inprotocol.d.tsto match actual Firefox behaviourPageError.locationandaddPageError()to acceptundefined?.+??fallbacks in the dispatcher and tracing recorder — consistent with how Chromium'sstackTraceToLocationalready handles the locationless casePage.uncaughtErrorwithoutlocationinto the protocol session and verifiespageerror/weberrorfire without crashingFixes #41169