Merge pull request #7665 from beakerbrowser/privilegedschemeopts
Add options to webFrame.registerURLSchemeAsPrivileged
This commit is contained in:
commit
ad48aeeea4
4 changed files with 136 additions and 27 deletions
|
@ -83,13 +83,27 @@ attackers.
|
|||
Resources will be loaded from this `scheme` regardless of the current page's
|
||||
Content Security Policy.
|
||||
|
||||
### `webFrame.registerURLSchemeAsPrivileged(scheme)`
|
||||
### `webFrame.registerURLSchemeAsPrivileged(scheme[, options])`
|
||||
|
||||
* `scheme` String
|
||||
* `options` Object (optional)
|
||||
* `secure` (optional) Default true.
|
||||
* `bypassCSP` (optional) Default true.
|
||||
* `allowServiceWorkers` (optional) Default true.
|
||||
* `supportFetchAPI` (optional) Default true.
|
||||
* `corsEnabled` (optional) Default true.
|
||||
|
||||
Registers the `scheme` as secure, bypasses content security policy for resources,
|
||||
allows registering ServiceWorker and supports fetch API.
|
||||
|
||||
Specify an option with the value of `false` to omit it from the registration.
|
||||
An example of registering a privileged scheme, without bypassing Content Security Policy:
|
||||
|
||||
```javascript
|
||||
const {webFrame} = require('electron')
|
||||
webFrame.registerURLSchemeAsPrivileged('foo', { bypassCSP: false })
|
||||
```
|
||||
|
||||
### `webFrame.insertText(text)`
|
||||
|
||||
* `text` String
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue