mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: [wc|bw]-created events do not emit an event object (#19465)
* fix: emit real Event instead of empty object in [wc|bw] * chore: add ability to emit empty events
This commit is contained in:
@@ -82,7 +82,8 @@ BrowserWindow.prototype._init = function () {
|
||||
}
|
||||
|
||||
// Notify the creation of the window.
|
||||
app.emit('browser-window-created', {}, this)
|
||||
const event = process.electronBinding('event').createEmpty()
|
||||
app.emit('browser-window-created', event, this)
|
||||
|
||||
Object.defineProperty(this, 'devToolsWebContents', {
|
||||
enumerable: true,
|
||||
|
||||
@@ -413,7 +413,8 @@ WebContents.prototype._init = function () {
|
||||
})
|
||||
}
|
||||
|
||||
app.emit('web-contents-created', {}, this)
|
||||
const event = process.electronBinding('event').createEmpty()
|
||||
app.emit('web-contents-created', event, this)
|
||||
}
|
||||
|
||||
// Deprecations
|
||||
|
||||
Reference in New Issue
Block a user