Command Line Options
You use following command line options when starting NW.js to change some default behaviors.
Load URL with the default app:
Run NW.js in Mixed Context Mode instead of Separate Context Mode.
An alternative way to specify the path of the app. This parameter is especially useful when testing with ChromeDriver.
Specify the data directory for your app, which contains the stored data, caches and crash dumps etc. By default the data directory is in following directories according to your platform:
<name-in-manifest> is the
name field in manifest.
Disable user’s access to devtools feature in SDK build.
Enable the Node.js integration in Web Workers. This will help you offload CPU hogging tasks with new threads, while exchange large amount of data with DOM efficiently with the structured clone algorithm.
Please note that binary modules of Node.js need to be thread-safe to be used in this way. We’ve made modifications to Node.js core to make sure core APIs are thread-safe, while we can not promise this with 3rd party binary modules. Pure JS modules are thread safe as long as they depends on thread-safe modules only. And there shouldn’t be any side effect when the feature is not turned on.
When it’s used, requestAnimationFrame() callback will continue to fire when window is minimized or hidden. It’s pretty useful for game developer. When the argument is not used, it behaves in the same way as Chrome browser and has no side effects.
Enable the chrome.gcm API.
These options are related to the transparent window feature. See Transparent Window for details.
Other Chromium Options
You can also use Chromium options listed in https://github.com/nwjs/chromium.src/blob/nw18/chrome/common/chrome_switches.cc and https://github.com/nwjs/chromium.src/blob/nw18/content/public/common/content_switches.cc . See also http://peter.sh/experiments/chromium-command-line-switches/
These options can be put into
chromium-args in manifest to get NW.js running with them each time.