mirror of
https://github.com/electron/electron.git
synced 2026-02-12 16:15:06 -05:00
fix: implement 'login' event for WebContents (#20954)
This commit is contained in:
@@ -105,9 +105,9 @@ if (process.platform === 'linux') {
|
||||
}
|
||||
|
||||
// Routes the events to webContents.
|
||||
const events = ['login', 'certificate-error', 'select-client-certificate']
|
||||
const events = ['certificate-error', 'select-client-certificate']
|
||||
for (const name of events) {
|
||||
app.on(name as 'login', (event, webContents, ...args: any[]) => {
|
||||
app.on(name as 'certificate-error', (event, webContents, ...args: any[]) => {
|
||||
webContents.emit(name, event, ...args)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -423,6 +423,10 @@ WebContents.prototype._init = function () {
|
||||
})
|
||||
}
|
||||
|
||||
this.on('login', (event, ...args) => {
|
||||
app.emit('login', event, this, ...args)
|
||||
})
|
||||
|
||||
const event = process.electronBinding('event').createEmpty()
|
||||
app.emit('web-contents-created', event, this)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user