Merge pull request #11059 from electron/clear-permissions-handler
Document setPermissionRequestHandler(null)
This commit is contained in:
commit
596a61f1ad
2 changed files with 4 additions and 3 deletions
|
@ -287,7 +287,7 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
|
||||||
|
|
||||||
#### `ses.setPermissionRequestHandler(handler)`
|
#### `ses.setPermissionRequestHandler(handler)`
|
||||||
|
|
||||||
* `handler` Function
|
* `handler` Function | null
|
||||||
* `webContents` [WebContents](web-contents.md) - WebContents requesting the permission.
|
* `webContents` [WebContents](web-contents.md) - WebContents requesting the permission.
|
||||||
* `permission` String - Enum of 'media', 'geolocation', 'notifications', 'midiSysex',
|
* `permission` String - Enum of 'media', 'geolocation', 'notifications', 'midiSysex',
|
||||||
'pointerLock', 'fullscreen', 'openExternal'.
|
'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`.
|
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.
|
Calling `callback(true)` will allow the permission and `callback(false)` will reject it.
|
||||||
|
To clear the handler, call `setPermissionRequestHandler(null)`.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const {session} = require('electron')
|
const {session} = require('electron')
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
"dotenv-safe": "^4.0.4",
|
"dotenv-safe": "^4.0.4",
|
||||||
"dugite": "^1.45.0",
|
"dugite": "^1.45.0",
|
||||||
"electabul": "~0.0.4",
|
"electabul": "~0.0.4",
|
||||||
"electron-docs-linter": "^2.3.3",
|
"electron-docs-linter": "^2.3.4",
|
||||||
"electron-typescript-definitions": "^1.2.10",
|
"electron-typescript-definitions": "^1.2.11",
|
||||||
"github": "^9.2.0",
|
"github": "^9.2.0",
|
||||||
"husky": "^0.14.3",
|
"husky": "^0.14.3",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
|
|
Loading…
Reference in a new issue