feat: add additional remote APIs filtering (#16293)
This commit is contained in:
parent
6436a12d7f
commit
349a3c20ae
8 changed files with 323 additions and 69 deletions
|
@ -377,17 +377,21 @@ WebContents.prototype._init = function () {
|
|||
})
|
||||
})
|
||||
|
||||
this.on('desktop-capturer-get-sources', (event, ...args) => {
|
||||
app.emit('desktop-capturer-get-sources', event, this, ...args)
|
||||
})
|
||||
const forwardedEvents = [
|
||||
'desktop-capturer-get-sources',
|
||||
'remote-require',
|
||||
'remote-get-global',
|
||||
'remote-get-builtin',
|
||||
'remote-get-current-window',
|
||||
'remote-get-current-web-contents',
|
||||
'remote-get-guest-web-contents'
|
||||
]
|
||||
|
||||
this.on('remote-require', (event, ...args) => {
|
||||
app.emit('remote-require', event, this, ...args)
|
||||
})
|
||||
|
||||
this.on('remote-get-global', (event, ...args) => {
|
||||
app.emit('remote-get-global', event, this, ...args)
|
||||
})
|
||||
for (const eventName of forwardedEvents) {
|
||||
this.on(eventName, (event, ...args) => {
|
||||
app.emit(eventName, event, this, ...args)
|
||||
})
|
||||
}
|
||||
|
||||
deprecate.event(this, 'did-get-response-details', '-did-get-response-details')
|
||||
deprecate.event(this, 'did-get-redirect-request', '-did-get-redirect-request')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue