feat: add webContents.getMediaSourceId() method (#31204)

* feat: add webContents.getMediaSourceId() method

* fix: account for null frame_hosts in webContents.getMediaSourceId()

* fix: move webContents.getMediaSourceId definition to be more organised

* fix: move webContents.getMediaSourceId implementation

* fix: move webContents.getMediaSourceId docs
This commit is contained in:
Mitchell McCaffrey 2021-10-26 11:03:59 +11:00 committed by GitHub
parent 63eed52626
commit 23cdf65c53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 0 deletions

View file

@ -1923,6 +1923,14 @@ Setting the WebRTC IP handling policy allows you to control which IPs are
exposed via WebRTC. See [BrowserLeaks](https://browserleaks.com/webrtc) for
more details.
#### `contents.getMediaSourceId(requestWebContents)`
* `requestWebContents` WebContents - Web contents that the id will be registered to.
Returns `String` - The identifier of a WebContents stream. This identifier can be used
with `navigator.mediaDevices.getUserMedia` using a `chromeMediaSource` of `tab`.
The identifier is restricted to the web contents that it is registered to and is only valid for 10 seconds.
#### `contents.getOSProcessId()`
Returns `Integer` - The operating system `pid` of the associated renderer