chore: fix lint errors (#16906)

This commit is contained in:
Robo 2019-02-13 00:19:47 +05:30 committed by GitHub
parent 98b05b8428
commit 5478cc7e8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,18 +76,21 @@ are disabled for non standard schemes. So in general if you want to register a
custom protocol to replace the `http` protocol, you have to register it as a standard scheme.
`protocol.registerSchemesAsPriviliged` can be used to replicate the functionality of the previous `protocol.registerStandardSchemes`, `webFrame.registerURLSchemeAs*` and `protocol.registerServiceWorkerSchemes` functions that existed prior to Electron 5.0.0, for example:
```
# before (<= v4.x)
**before (<= v4.x)**
```javascript
// Main
protocol.registerStandardSchemes(['scheme1', 'scheme2'], { secure: true })
// Renderer
webFrame.registerURLSchemeAsPrivileged('scheme1', { secure: true })
webFrame.registerURLSchemeAsPrivileged('scheme2', { secure: true })
```
# after (>= v5.x)
**after (>= v5.x)**
```javascript
protocol.registerSchemesAsPriviliged([
{ scheme: 'scheme1', privileges: { standard: true, secure: true } },
{ scheme: 'scheme2', privileges: { standard: true, secure: true } },
{ scheme: 'scheme2', privileges: { standard: true, secure: true } }
])
```