Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local Extension Path? #56

Open
IceHacks opened this issue Jul 26, 2019 · 7 comments
Open

Local Extension Path? #56

IceHacks opened this issue Jul 26, 2019 · 7 comments

Comments

@IceHacks
Copy link

I was wondering if you can use this to load a local extension (like one not on the webstore). Right now I am trying but I get this error:

(node:13020) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'scanInstalledExtensions' of undefined
    at ECx.<anonymous> (C:\path\electron-chrome-extension\lib\browser\engine\api.js:30:36)
    at Generator.next (<anonymous>)
    at C:\path\node_modules\tslib\tslib.js:110:75
    at new Promise (<anonymous>)
    at Object.__awaiter (C:\Users\BakedPotato\Desktop\surviv-bot\my-app\node_modules\tslib\tslib.js:106:16)
    at ECx.load (C:\path\node_modules\electron-chrome-extension\lib\browser\engine\api.js:28:24)
    at App.createWindow (C:\path\src\index.js:12:6)
    at App.emit (events.js:199:15)
(node:13020) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13020) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit 
code.
@theharshin
Copy link

@IceHacks Do you have the solution? I'm stuck at the same error!

@IceHacks
Copy link
Author

IceHacks commented Oct 9, 2019

@theharshin no I never found one.

@rangerscience
Copy link

I'd like to see this feature, as well.

@rangerscience
Copy link

Hi, okay, I'm still running into various odd issues and can't actually tell if this is working, but this is the code that I wrote to make it happen. I literally just stuck it into the right place in the node_modules/... file. Ideally at some point I learn TypeScript and whatever build process and submit it here - or, given the lack of attention by the authors, a fork ;)

lib/browser/engine/api.js:

    load(extensionId) {...}
    localLoad(name, version) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            if (this.loaded.has(name)) {
                return this.loaded.get(name);
            }
            const location = `./vendor/${name}/${version}`
            const extension = yield {
              id: name,
              location: location,
              version: version,
              updateUrl: ''
            }
            chrome_extension_1.addExtension(name, location);
            this.loaded.set(name, extension);
            console.log("extension", extension)
            return extension;
        });
    }

@IceHacks
Copy link
Author

nice ;)

@mattrq
Copy link

mattrq commented Jun 10, 2020

Found a fix without changing the library

Call ECx.setConfiguration(); before calling load or any other function that references the fetcher property.

@freekingg
Copy link

I also want to load local plug-ins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants