Minor doc edits and link to MDN page

This commit is contained in:
Kevin Sawicki 2016-08-24 09:03:44 -07:00
parent 62cb8428fb
commit 4ce2c221c9
2 changed files with 7 additions and 5 deletions

View file

@ -47,10 +47,11 @@ non-standard schemes can not recognize relative URLs:
<img src='test.png'> <img src='test.png'>
</body> </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 Registering a scheme as standard will allow access to files through the
scheme. So in general if you want to register a custom protocol to replace the [FileSystem API][file-system-api]. Otherwise the renderer will throw a security
`http` protocol, you have to register it as standard scheme: 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 ```javascript
const {app, protocol} = require('electron') 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. 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 [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

View file

@ -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') let filePath = path.join(__dirname, 'fixtures', 'pages', 'filesystem.html')
const handler = function (request, callback) { const handler = function (request, callback) {
callback({path: filePath}) callback({path: filePath})