Nw.js: How to load extensions automatically in an extension?

Created on 9 Jun 2017  路  3Comments  路  Source: nwjs/nw.js

Hi there,

We can load extensions by passing --load-extension to NW. It works for only development version, if we want to distribute an app that comes with an extension, it looks not possible. I tried changing CFBundleExecutable but it doesn't accept any parameters, also pointing to another script fails.

Any workarounds or ideas ?

question

Most helpful comment

For those that arrive here from google: --load-extension is actually a Chromium command line argument, so you can put it in the chromium-args key of the manifest as so:

"chromium-args": "--enable-logging=stderr --load-extension='./relative/path/to/ppbllmlcmhfnfflbkbinnhacecaankdh'". Somewhat surprisingly, I got this to work on Windows 7 with a relative path with forward slashes.

Lesson: you don't need a script to include a chrome extension in your nw.js app!

All 3 comments

Does putting --load-extension in chromium-args in package.json work for you?

@rogerwang I created an external script actually, it worked for me.

For those that arrive here from google: --load-extension is actually a Chromium command line argument, so you can put it in the chromium-args key of the manifest as so:

"chromium-args": "--enable-logging=stderr --load-extension='./relative/path/to/ppbllmlcmhfnfflbkbinnhacecaankdh'". Somewhat surprisingly, I got this to work on Windows 7 with a relative path with forward slashes.

Lesson: you don't need a script to include a chrome extension in your nw.js app!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jportoles picture jportoles  路  3Comments

imyzf picture imyzf  路  4Comments

nawazishali picture nawazishali  路  3Comments

rumax picture rumax  路  4Comments

adam-lynch picture adam-lynch  路  4Comments