fix: implement 'login' event for WebContents (#20954)
This commit is contained in:
parent
049bd09150
commit
034f4d5734
16 changed files with 239 additions and 247 deletions
|
@ -314,10 +314,8 @@ Returns:
|
|||
|
||||
* `event` Event
|
||||
* `webContents` [WebContents](web-contents.md)
|
||||
* `request` Object
|
||||
* `method` String
|
||||
* `authenticationResponseDetails` Object
|
||||
* `url` URL
|
||||
* `referrer` URL
|
||||
* `authInfo` Object
|
||||
* `isProxy` Boolean
|
||||
* `scheme` String
|
||||
|
@ -337,7 +335,7 @@ should prevent the default behavior with `event.preventDefault()` and call
|
|||
```javascript
|
||||
const { app } = require('electron')
|
||||
|
||||
app.on('login', (event, webContents, request, authInfo, callback) => {
|
||||
app.on('login', (event, webContents, details, authInfo, callback) => {
|
||||
event.preventDefault()
|
||||
callback('username', 'secret')
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue