#53665: fix: resolve the capturing webContents in setDisplayMediaRequestHandler
Merged
Created: Sep 7, 2026, 4:05:44 AM
Merged: Sep 7, 2026, 4:57:10 AM
5 comments
Target: main
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.- Passing a
WebFrameMainwhose frame has been destroyed asvideo/audiothrows aTypeErrorinstead of crashing; a request whose own frame is gone fails cleanly. - A
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 setDisplayMediaRequestHandler when the granted frame had been destroyed or another tab was granted by id.
Backports
Semver Impact
Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron