Toggle chromium-args programatically #1782

375 views
Skip to first unread message

ivan.to...@gmail.com

unread,
Apr 19, 2014, 5:54:42 PM4/19/14
to node-...@googlegroups.com
This is a copy of https://github.com/rogerwang/node-webkit/issues/1782

Can't find a way to programatically toggle/modify a chromium-args.

Editing package.json works, but only if the app is not packaged. Once it's packaged it's impossible to edit this file.

I think this is isn't possible, and probably never will... but I ask anyways. Do you know how I could achieve that?

I think for this to work, nodewebkit should allow execution of a node script that sets some configuration params (probably extending package.json configs) before launching webkit, allowing to read a config file and act accordingly.

--

Another solution for me could be to pass through chromium-args from app argv, allowing end users to enable/disable advanced features (just like chrome does)

Example:

nodewebkit path/to/my/app/ --chromium-args="--arg1 --arg2 --etc"

Laszlo Z. Antal

unread,
Apr 19, 2014, 10:10:08 PM4/19/14
to node-...@googlegroups.com
Hi,

Open a new window using nw.gui and pass in your conf object. 
https://github.com/rogerwang/node-webkit/wiki/Window

Laszlo
http://twitter.com/LZAntal

--
You received this message because you are subscribed to the Google Groups "node-webkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-webkit...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Iván Todorovich

unread,
Apr 19, 2014, 10:22:12 PM4/19/14
to node-...@googlegroups.com
Hi Laszlo,

According to the documentation "All window subfields in Manifest format can be used. ", but chromium-args is not a window subfield.


Iván Todorovich


--
You received this message because you are subscribed to a topic in the Google Groups "node-webkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-webkit/73eLCp-TvmM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-webkit...@googlegroups.com.

Laszlo Z. Antal

unread,
Apr 19, 2014, 10:30:44 PM4/19/14
to node-...@googlegroups.com
Hi

On Apr 19, 2014, at 19:22, Iván Todorovich <ivan.to...@gmail.com> wrote:

Hi Laszlo,

According to the documentation "All window subfields in Manifest format can be used. ", but chromium-args is not a window subfield.


Iván Todorovich

Hmm I could've sworn it worked for me before. But I only used it once a whole ago. 
Then use child_process to open a new nw and pass on the arguments to enable features. You could create a menu to pick the options then run it. 

Hope it helps

Laszlo

Iván Todorovich

unread,
Apr 19, 2014, 10:43:09 PM4/19/14
to node-...@googlegroups.com
How can I pass on chromium-args to the child process ? I believe it has to be defined in package.json.

In fact, If I could pass on chromium-args when I execute nodewebkit I would settle for that option, letting the user enabling this feature using my packaged application args (Just like Chrome does). But I believe it is not possible right now.

In my original post I suggest this approach, but it would require modifying the code to accept a "--chromium-args=..." argument, and passing it on to chromium.

But maybe some people don't want end users modifying chromium-args.. so it should probably be a setting.

Iván Todorovich

Laszlo Z. Antal

unread,
Apr 19, 2014, 11:36:19 PM4/19/14
to node-...@googlegroups.com

Iván Todorovich

unread,
Apr 27, 2014, 9:35:37 PM4/27/14
to node-...@googlegroups.com
Sorry for the late response.

I know about chromium command options, but they don't apply for node-webkit, without specifically setting them in the package.json..

Pier Bover

unread,
Mar 6, 2015, 1:50:48 AM3/6/15
to nwjs-g...@googlegroups.com, node-...@googlegroups.com
Hey Ivan

Did you find a solution to this?

Iván Todorovich

unread,
Mar 6, 2015, 6:12:05 AM3/6/15
to nwjs-g...@googlegroups.com, node-...@googlegroups.com

No, I did not.


El vie., mar. 6, 2015 3:50 AM, Pier Bover <pierb...@gmail.com> escribió:
Hey Ivan

Did you find a solution to this?

--
You received this message because you are subscribed to a topic in the Google Groups "nw.js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nwjs-general/73eLCp-TvmM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nwjs-general...@googlegroups.com.

graeme....@gmail.com

unread,
Mar 22, 2016, 8:51:15 PM3/22/16
to nw.js, node-...@googlegroups.com
Hi Ivan,

Chromium args work with the nwjs binary (0.12.3).  Just pass them in as regular arguments (ie. do not prefix with chromium-args like in the package.json)

Example:

nwjs.exe myapp.app --remote-debugging-port=9222


You can also pass in js-flags but they are passed in a single field:

nwjs.exe myapp.app --js-args='--expose-gc'
Reply all
Reply to author
Forward
0 new messages