refactor: add emitCustomEvent() helper (#17960)

This commit is contained in:
Milan Burda 2019-05-01 15:07:57 +02:00 committed by Alexey Kuzmin
parent aebad6fd21
commit 6f5c850d60
5 changed files with 35 additions and 48 deletions

View file

@ -350,22 +350,6 @@ WebContents.prototype._init = function () {
})
})
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'
]
for (const eventName of forwardedEvents) {
this.on(eventName, (event, ...args) => {
app.emit(eventName, event, this, ...args)
})
}
this.on('crashed', (event, ...args) => {
app.emit('renderer-process-crashed', event, this, ...args)
})