Skip to content

Commit

Permalink
chore: fix lint errors (#16906)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak1556 committed Feb 12, 2019
1 parent 98b05b8 commit 5478cc7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/api/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 } }
])
```

Expand Down

0 comments on commit 5478cc7

Please sign in to comment.