docs: login event
This commit is contained in:
parent
569e87035a
commit
862c3187f5
2 changed files with 60 additions and 8 deletions
|
@ -133,18 +133,23 @@ Emitted when a new [browserWindow](browser-window.md) is created.
|
||||||
|
|
||||||
### Event: 'select-certificate'
|
### Event: 'select-certificate'
|
||||||
|
|
||||||
Emitted when a client certificate is requested.
|
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
* `event` Event
|
* `event` Event
|
||||||
* `webContents` [WebContents](browser-window.md#class-webcontents)
|
* `webContents` [WebContents](web-contents.md)
|
||||||
* `url` String
|
* `url` URL
|
||||||
* `certificateList` [Objects]
|
* `certificateList` [Objects]
|
||||||
* `data` PEM encoded data
|
* `data` PEM encoded data
|
||||||
* `issuerName` Issuer's Common Name
|
* `issuerName` Issuer's Common Name
|
||||||
* `callback` Function
|
* `callback` Function
|
||||||
|
|
||||||
|
Emitted when a client certificate is requested.
|
||||||
|
|
||||||
|
The `url` corresponds to the navigation entry requesting the client certificate
|
||||||
|
and `callback` needs to be called with an entry filtered from the list. Using
|
||||||
|
`event.preventDefault()` prevents the application from using the first
|
||||||
|
certificate from the store.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
app.on('select-certificate', function(event, host, url, list, callback) {
|
app.on('select-certificate', function(event, host, url, list, callback) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -152,10 +157,36 @@ app.on('select-certificate', function(event, host, url, list, callback) {
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
The `url` corresponds to the navigation entry requesting the client certificate
|
### Event: 'login'
|
||||||
and `callback` needs to be called with an entry filtered from the list. Using
|
|
||||||
`event.preventDefault()` prevents the application from using the first
|
Returns:
|
||||||
certificate from the store.
|
|
||||||
|
* `event` Event
|
||||||
|
* `webContents` [WebContents](web-contents.md)
|
||||||
|
* `request` Object
|
||||||
|
* `method` String
|
||||||
|
* `url` URL
|
||||||
|
* `referrer` URL
|
||||||
|
* `authInfo` Object
|
||||||
|
* `isProxy` Boolean
|
||||||
|
* `scheme` String
|
||||||
|
* `host` String
|
||||||
|
* `port` Integer
|
||||||
|
* `realm` String
|
||||||
|
* `callback` Function
|
||||||
|
|
||||||
|
Emitted when `webContents` wants to do basic auth.
|
||||||
|
|
||||||
|
The default behavior is to cancel all authentications, to override this you
|
||||||
|
should prevent the default behavior with `event.preventDefault()` and call
|
||||||
|
`callback(username, password)` with the credentials.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
app.on('login', function(event, webContents, request, authInfo, callback) {
|
||||||
|
event.preventDefault();
|
||||||
|
callback('username', 'secret');
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
### Event: 'gpu-process-crashed'
|
### Event: 'gpu-process-crashed'
|
||||||
|
|
||||||
|
|
|
@ -167,6 +167,27 @@ Emitted when DevTools is closed.
|
||||||
|
|
||||||
Emitted when DevTools is focused / opened.
|
Emitted when DevTools is focused / opened.
|
||||||
|
|
||||||
|
### Event: 'login'
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
* `event` Event
|
||||||
|
* `request` Object
|
||||||
|
* `method` String
|
||||||
|
* `url` URL
|
||||||
|
* `referrer` URL
|
||||||
|
* `authInfo` Object
|
||||||
|
* `isProxy` Boolean
|
||||||
|
* `scheme` String
|
||||||
|
* `host` String
|
||||||
|
* `port` Integer
|
||||||
|
* `realm` String
|
||||||
|
* `callback` Function
|
||||||
|
|
||||||
|
Emitted when `webContents` wants to do basic auth.
|
||||||
|
|
||||||
|
The usage is the same with [the `login` event of `app`](app.md#event-login).
|
||||||
|
|
||||||
## Instance Methods
|
## Instance Methods
|
||||||
|
|
||||||
The `webContents` object has the following instance methods:
|
The `webContents` object has the following instance methods:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue