fix: update docs for protocol API (#16601)

* fix: update docs for protocol API

* upddate source for new attribute name

* update electron-typescript-definitions package
This commit is contained in:
Nitish Sakhawalkar 2019-01-30 12:54:18 -08:00 committed by Samuel Attard
parent 641b47f384
commit bd4e14dcee
6 changed files with 32 additions and 29 deletions

View file

@ -28,9 +28,9 @@ of the `app` module gets emitted.
The `protocol` module has the following methods:
### `protocol.registerSchemesAsPrivileged(schemes[, options])`
### `protocol.registerSchemesAsPrivileged(customSchemes)`
* `custom_schemes` [CustomScheme[]](structures/custom-scheme.md)
* `customSchemes` [CustomScheme[]](structures/custom-scheme.md)
**Note:** This method can only be used before the `ready` event of the `app`
@ -39,13 +39,13 @@ module gets emitted and can be called only once.
Registers the `scheme` as standard, secure, bypasses content security policy for resources,
allows registering ServiceWorker and supports fetch API.
Specify an option with the value of `true` to enable the capability.
Specify a privilege with the value of `true` to enable the capability.
An example of registering a privileged scheme, with bypassing Content Security Policy:
```javascript
const { protocol } = require('electron')
protocol.registerSchemesAsPrivileged([
{ scheme: 'foo', options: { bypassCSP: true } }
{ scheme: 'foo', privileges: { bypassCSP: true } }
])
```

View file

@ -1,7 +1,7 @@
# CustomScheme Object
* `scheme` String - Custom schemes to be registered with options.
* `options` Object (optional)
* `privileges` Object (optional)
* `standard` Boolean (optional) - Default false.
* `secure` Boolean (optional) - Default false.
* `bypassCSP` Boolean (optional) - Default false.