add options to webFrame.registerURLSchemeAsPrivileged

This commit is contained in:
Paul Frazee 2016-10-18 15:52:41 -05:00
parent 104f8d6057
commit a5c62bb264
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` Default true.
* `bypassCSP` Default true.
* `allowServiceWorkers` Default true.
* `supportFetchAPI` Default true.
* `corsEnabled` 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