Minor doc edits and link to MDN page
This commit is contained in:
parent
62cb8428fb
commit
4ce2c221c9
2 changed files with 7 additions and 5 deletions
|
@ -47,10 +47,11 @@ non-standard schemes can not recognize relative URLs:
|
|||
<img src='test.png'>
|
||||
</body>
|
||||
```
|
||||
Registering a scheme as standard, will allow access of files through
|
||||
the FileSystem API. Otherwise the renderer will throw a security error for the
|
||||
scheme. So in general if you want to register a custom protocol to replace the
|
||||
`http` protocol, you have to register it as standard scheme:
|
||||
|
||||
Registering a scheme as standard will allow access to files through the
|
||||
[FileSystem API][file-system-api]. Otherwise the renderer will throw a security
|
||||
error for the scheme. 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:
|
||||
|
||||
```javascript
|
||||
const {app, protocol} = require('electron')
|
||||
|
@ -229,3 +230,4 @@ which sends a new HTTP request as a response.
|
|||
Remove the interceptor installed for `scheme` and restore its original handler.
|
||||
|
||||
[net-error]: https://code.google.com/p/chromium/codesearch#chromium/src/net/base/net_error_list.h
|
||||
[file-system-api]: https://developer.mozilla.org/en-US/docs/Web/API/LocalFileSystem
|
||||
|
|
|
@ -966,7 +966,7 @@ describe('protocol module', function () {
|
|||
})
|
||||
})
|
||||
|
||||
it('can access files through FileSystem API', function (done) {
|
||||
it('can access files through the FileSystem API', function (done) {
|
||||
let filePath = path.join(__dirname, 'fixtures', 'pages', 'filesystem.html')
|
||||
const handler = function (request, callback) {
|
||||
callback({path: filePath})
|
||||
|
|
Loading…
Reference in a new issue