Description
In our app, we reference all of assets with url with different protocols.
I'm currently working on build the distribution app and want to use asar to make a package of the whole app.
We load the start page like this:
BrowserWindow.loadUrl('asar:' + __dirname + '/static/dashboard.html');
That part alone works, but as soon as I added a protocol.registerProtocol for 'asar' protocol the above page could not be load:
Protocol.registerProtocol('asar', function(request) {
//do some work with request url
return new Protocol.RequestFileJob(url);
});
In the console it says:
Failed to load resource: asar:/path/to/MyApp.app/Contents/Resources/app.asar/static/dashboard.html
The same code would work fine with normal app
folder even though I use 'asar' protocols for all my asset reference urls.
I suspect that Protocol.RequestFileJob(url)
does not work for inside asar package, but not sure how to dig deeper.