fix: resolve the capturing webContents in setDisplayMediaRequestHandler - #53665
Merged
Conversation
* compute capture handle / zoom / incognito checks against the WebContents that called getDisplayMedia() instead of nullptr (crashed once the captured page set a permissive capture-handle config) or the captured tab * throw a TypeError instead of dereferencing null when `video` / `audio` is a WebFrameMain whose frame has been destroyed; fail the request cleanly if the requesting frame itself is gone * a WebFrameMain grant is normalised to its outermost main frame: content captures whole tabs, and the docs now say so (with a top-level-only example) * specs for all three
MarshallOfSound
enabled auto-merge (squash)
September 7, 2026 09:08
codebytere
approved these changes
Sep 7, 2026
|
Release Notes Persisted
|
This was referenced Sep 7, 2026
Contributor
|
I have automatically backported this PR to "43-x-y", please check out #53671 |
Contributor
|
I have automatically backported this PR to "44-x-y", please check out #53672 |
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #53673 |
Contributor
|
I have automatically backported this PR to "42-x-y", please check out #53674 |
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.
setDisplayMediaRequestHandler: capture-handle, zoom and cross-session checks are computed against the WebContents that calledgetDisplayMedia(); previously this could dereference null when granting another tab by id.WebFrameMainwhose frame has been destroyed asvideo/audiothrows aTypeErrorinstead of crashing; a request whose own frame is gone fails cleanly.WebFrameMaingrant captures the tab that contains the frame; the docs now say so and the example only self-captures top-level frames.Notes: Fixed crashes in
setDisplayMediaRequestHandlerwhen the granted frame had been destroyed or another tab was granted by id.