Local Extension Path?
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.
@IceHacks Do you have the solution? I'm stuck at the same error!
@theharshin no I never found one.
I'd like to see this feature, as well.
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;
});
}
nice ;)
Found a fix without changing the library
Call ECx.setConfiguration(); before calling load or any other function that references the fetcher property.
I also want to load local plug-ins