fix ERR_UNKNOWN_URL_SCHEME by intercepting file:// protocol

fix whitespace

Revert "fix whitespace"

This reverts commit 608e364ebbabb19ffd6c3e3e0f357251c2e8e348.

fix whitespace
This commit is contained in:
duncan
2020-08-13 20:28:36 +01:00
parent 3dea16798b
commit a49b2ce278

View File

@@ -1,5 +1,6 @@
const { app } = require('electron');
const { BrowserWindow } = require('electron');
const { protocol } = require('electron');
const path = require('path');
const cProcess = require('child_process').spawn;
const portscanner = require('portscanner');
@@ -51,6 +52,14 @@ if (manifestJsonFile.singleInstance || manifestJsonFile.aspCoreBackendPort) {
}
app.on('ready', () => {
// Fix ERR_UNKNOWN_URL_SCHEME using file protocol
// https://github.com/electron/electron/issues/23757
protocol.registerFileProtocol('file', (request, callback) => {
const pathname = request.url.replace('file:///', '');
callback(pathname);
});
if (isSplashScreenEnabled()) {
startSplashScreen();
}
@@ -273,4 +282,4 @@ function getEnvironmentParameter() {
}
return '';
}
}