Search code examples
javascriptgoogle-chrome-extensionelectronadd-on

How can I add a custom chrome extension to my Electron app?


I am facing some trouble adding chrome addons into my Electron BrowserWindow.

Before creating my window (and after the ready event has fired), I try to add a devtools extension that my browser needs to do screen sharing.

BrowserWindow.addDevToolsExtension('/home/USER/.config/chromium/Default/Extensions/dkjdkjlcilokfaigbckcipicchgoazeg/1.5_0');

I followed this Electron guide, and it worked for their example (adding the react develop tool). When I do the exact same thing with my own chrome extension I have this error:

[4735:1116/163422.268391:ERROR:CONSOLE(7701)] "Skipping extension with invalid URL: chrome-extension://extension-name", source: chrome-devtools://devtools/bundled/shell.js (7701)

I don't really get why the error specified is "invalid URL" since I'm doing the exact same thing / process with the react addon without a problem. I also have no idea what to do. Is it possible that my chrome addon is not Electron-compatible?


Solution

  • Support for Chromium extensions in Electron is actively being worked on at the moment. The support isn't complete yet, but the GitHub issue seems to have regular updates being posted.

    Fingers crossed!

    A current pull request is open for 'just enough extensions [api] to load a simple ... extension'