Merge pull request #11059 from electron/clear-permissions-handler

Document setPermissionRequestHandler(null)
This commit is contained in:
Cheng Zhao 2017-11-21 09:50:17 +09:00 committed by GitHub
commit 596a61f1ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -287,7 +287,7 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
#### `ses.setPermissionRequestHandler(handler)`
* `handler` Function
* `handler` Function | null
* `webContents` [WebContents](web-contents.md) - WebContents requesting the permission.
* `permission` String - Enum of 'media', 'geolocation', 'notifications', 'midiSysex',
'pointerLock', 'fullscreen', 'openExternal'.
@ -296,6 +296,7 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
Sets the handler which can be used to respond to permission requests for the `session`.
Calling `callback(true)` will allow the permission and `callback(false)` will reject it.
To clear the handler, call `setPermissionRequestHandler(null)`.
```javascript
const {session} = require('electron')