security: allow to block desktopCapturer.getSources() calls (#15964)

* security: allow to block desktopCapturer.getSources() calls

* return empty instead of error

* fix: release resources of DesktopCapturer on exit
This commit is contained in:
Milan Burda 2018-12-20 03:44:30 +01:00 committed by Cheng Zhao
parent df0381e76c
commit 547097b036
9 changed files with 76 additions and 16 deletions

View file

@ -401,6 +401,16 @@ gets emitted.
**Note:** Extra command line arguments might be added by Chromium,
such as `--original-process-start-time`.
### Event: 'desktop-capturer-get-sources'
Returns:
* `event` Event
* `webContents` [WebContents](web-contents.md)
Emitted when `desktopCapturer.getSources()` is called in the renderer process of `webContents`.
Calling `event.preventDefault()` will make it return empty sources.
### Event: 'remote-require'
Returns:

View file

@ -663,6 +663,15 @@ Returns:
Emitted when the associated window logs a console message. Will not be emitted
for windows with *offscreen rendering* enabled.
#### Event: 'desktop-capturer-get-sources'
Returns:
* `event` Event
Emitted when `desktopCapturer.getSources()` is called in the renderer process.
Calling `event.preventDefault()` will make it return empty sources.
#### Event: 'remote-require'
Returns: