Skip to content

fix: resolve the capturing webContents in setDisplayMediaRequestHandler - #53665

Merged
MarshallOfSound merged 1 commit into
mainfrom
fix/display-media-frame-handling
Sep 7, 2026
Merged

fix: resolve the capturing webContents in setDisplayMediaRequestHandler#53665
MarshallOfSound merged 1 commit into
mainfrom
fix/display-media-frame-handling

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member
  • setDisplayMediaRequestHandler: capture-handle, zoom and cross-session checks are computed against the WebContents that called getDisplayMedia(); previously this could dereference null when granting another tab by id.
  • Passing a WebFrameMain whose frame has been destroyed as video / audio throws a TypeError instead of crashing; a request whose own frame is gone fails cleanly.
  • A WebFrameMain grant 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 setDisplayMediaRequestHandler when the granted frame had been destroyed or another tab was granted by id.

* 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 MarshallOfSound added semver/patch backwards-compatible bug fixes target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. labels Sep 7, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Sep 7, 2026
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) September 7, 2026 09:08
@MarshallOfSound
MarshallOfSound merged commit 4c09713 into main Sep 7, 2026
117 checks passed
@MarshallOfSound
MarshallOfSound deleted the fix/display-media-frame-handling branch September 7, 2026 09:57
@release-clerk

release-clerk Bot commented Sep 7, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed crashes in setDisplayMediaRequestHandler when the granted frame had been destroyed or another tab was granted by id.

@trop

trop Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "43-x-y", please check out #53671

@trop trop Bot added the in-flight/43-x-y label Sep 7, 2026
@trop

trop Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "44-x-y", please check out #53672

@trop trop Bot removed the target/43-x-y PR should also be added to the "43-x-y" branch. label Sep 7, 2026
@trop

trop Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "45-x-y", please check out #53673

@trop

trop Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "42-x-y", please check out #53674

@trop trop Bot added in-flight/44-x-y in-flight/45-x-y in-flight/42-x-y and removed target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. in-flight/42-x-y labels Sep 7, 2026
@trop trop Bot added merged/42-x-y PR was merged to the "42-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. and removed in-flight/44-x-y in-flight/45-x-y in-flight/43-x-y labels Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. new-pr 🌱 PR opened recently semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants