Merge pull request #7665 from beakerbrowser/privilegedschemeopts

Add options to webFrame.registerURLSchemeAsPrivileged
This commit is contained in:
Cheng Zhao 2016-10-24 15:56:18 +09:00 committed by GitHub
commit ad48aeeea4
4 changed files with 136 additions and 27 deletions

View file

@ -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