8000 Can not load files in asar archives in custom protocols · Issue #1069 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Can not load files in asar archives in custom protocols #1069
@nantas

Description

@nantas

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0