add protocol to support system file link

This commit is contained in:
MathieuG-P
2022-11-06 01:33:03 +01:00
parent a4f4eb5558
commit 788b7598b0
+9 -2
View File
@@ -9,7 +9,7 @@
* `./src/main.js` using webpack. This gives us some performance wins.
*/
import path from 'path';
import { app } from 'electron';
import { app, protocol } from 'electron';
import log from 'electron-log';
import './ipcs';
import { UtilsService } from './services/utils.service';
@@ -62,4 +62,11 @@ app.on('window-all-closed', () => {
app.whenReady().then(() => {
createWindow();
}).catch(log.error);
}).catch(log.error);
app.whenReady().then(() => {
protocol.registerFileProtocol('file', (request, callback) => {
const pathname = decodeURI(request.url.replace('file:///', ''));
callback(pathname);
});
});