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

@ -377,6 +377,10 @@ WebContents.prototype._init = function () {
})
})
this.on('desktop-capturer-get-sources', (event, ...args) => {
app.emit('desktop-capturer-get-sources', event, this, ...args)
})
this.on('remote-require', (event, ...args) => {
app.emit('remote-require', event, this, ...args)
})