Skip to content

fix: require a registered source id for webContents capture via getUserMedia - #53687

Merged
MarshallOfSound merged 1 commit into
mainfrom
fix/web-contents-capture-via-source-id
Sep 7, 2026
Merged

MarshallOfSound merged 1 commit into
mainfrom
fix/web-contents-capture-via-source-id

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member
  • The legacy chromeMediaSource: 'desktop' getUserMedia constraint accepts screen and window source ids only; a web-contents-media-stream:// id there is rejected with "Invalid state".
  • Capturing a WebContents keeps working through chromeMediaSource: 'tab' with an id from webContents.getMediaSourceId() (bound to the requesting contents) and through setDisplayMediaRequestHandler.
  • Spec and a getMediaSourceId doc note.

Notes: getUserMedia with chromeMediaSource: 'desktop' no longer accepts WebContents source ids; use chromeMediaSource: 'tab' with webContents.getMediaSourceId() or setDisplayMediaRequestHandler to capture a WebContents.

…erMedia

* the legacy `chromeMediaSource: 'desktop'` getUserMedia path only accepts
  screen and window ids; a `web-contents-media-stream://` id there is
  rejected with "Invalid state" instead of starting a capture of that
  WebContents
* WebContents capture keeps working through `chromeMediaSource: 'tab'` with
  an id from webContents.getMediaSourceId() (bound to the requesting
  contents) and through setDisplayMediaRequestHandler
* spec + getMediaSourceId doc note
@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 self-assigned this Sep 7, 2026
@MarshallOfSound
MarshallOfSound merged commit d81953f into main Sep 7, 2026
147 checks passed
@release-clerk

release-clerk Bot commented Sep 7, 2026

Copy link
Copy Markdown

Release Notes Persisted

getUserMedia with chromeMediaSource: 'desktop' no longer accepts WebContents source ids; use chromeMediaSource: 'tab' with webContents.getMediaSourceId() or setDisplayMediaRequestHandler to capture a WebContents.

@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 #53707

@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 "45-x-y", please check out #53708

@trop trop Bot added in-flight/45-x-y and removed target/43-x-y PR should also be added to the "43-x-y" branch. labels 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 #53709

@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 #53710

@trop trop Bot added in-flight/44-x-y in-flight/42-x-y merged/45-x-y PR was merged to the "45-x-y" branch. 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. and removed target/45-x-y PR should also be added to the "45-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. in-flight/45-x-y in-flight/42-x-y in-flight/43-x-y in-flight/44-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

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants