File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 11const { app } = require ( 'electron' ) ;
22const { BrowserWindow } = require ( 'electron' ) ;
3+ const { protocol } = require ( 'electron' ) ;
34const path = require ( 'path' ) ;
45const cProcess = require ( 'child_process' ) . spawn ;
56const portscanner = require ( 'portscanner' ) ;
@@ -51,6 +52,14 @@ if (manifestJsonFile.singleInstance || manifestJsonFile.aspCoreBackendPort) {
5152}
5253
5354app . on ( 'ready' , ( ) => {
55+
56+ // Fix ERR_UNKNOWN_URL_SCHEME using file protocol
57+ // https://github.com/electron/electron/issues/23757
58+ protocol . registerFileProtocol ( 'file' , ( request , callback ) => {
59+ const pathname = request . url . replace ( 'file:///' , '' ) ;
60+ callback ( pathname ) ;
61+ } ) ;
62+
5463 if ( isSplashScreenEnabled ( ) ) {
5564 startSplashScreen ( ) ;
5665 }
@@ -273,4 +282,4 @@ function getEnvironmentParameter() {
273282 }
274283
275284 return '' ;
276- }
285+ }
You can’t perform that action at this time.
0 commit comments