How to add extension using Electron API?


#1

Not sure is it issue or feature. I am trying to add an extension (not DevTool, but a metamask extension) to the electron application using Electron API (BrowserWindow.addExtension(path)) and always get a error

Skipping extension with invalid URL

Before calling of addExtension (on app ready event) I downloading an extension .crx file and unziping it into subfolder in userData directory.

So, is it possible to add extension using Electron API?


#2

What URL are you using?


#3

I cannot define this URL by myself. I can provide a path to the extension directory only (according to documentation). I providing a path to the directory and then electron API do build an URL like: chrome-extension://[extension-name]. Extension name is defined in the manifest.json