📝 Fix code style issue
* Change `var` to `let`. * Change `function() {}` to `() => {}`. * Use shorthand function syntax on object notation. * Remove spaces between object notation brackets. * Small fixes.
This commit is contained in:
parent
139a4f984a
commit
f1b184ef78
23 changed files with 64 additions and 67 deletions
|
@ -9,11 +9,11 @@ An example of implementing a protocol that has the same effect as the
|
|||
const {app, protocol} = require('electron');
|
||||
const path = require('path');
|
||||
|
||||
app.on('ready', function () {
|
||||
protocol.registerFileProtocol('atom', function (request, callback) {
|
||||
app.on('ready', () => {
|
||||
protocol.registerFileProtocol('atom', (request, callback) => {
|
||||
const url = request.url.substr(7);
|
||||
callback({path: path.normalize(__dirname + '/' + url)});
|
||||
}, function (error) {
|
||||
}, (error) => {
|
||||
if (error)
|
||||
console.error('Failed to register protocol');
|
||||
});
|
||||
|
@ -53,7 +53,7 @@ have to register it as standard scheme:
|
|||
|
||||
```javascript
|
||||
protocol.registerStandardSchemes(['atom']);
|
||||
app.on('ready', function () {
|
||||
app.on('ready', () => {
|
||||
protocol.registerHttpProtocol('atom', ...);
|
||||
});
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue