-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Since v0.3.1
// Load native UI library
var gui = require('nw.gui');
// Print arguments
console.log(gui.App.argv);
// Quit current app
gui.App.quit();
Get the command line arguments when starting the app.
Get all the command line arguments when starting the app. Because node-webkit itself used switches like --no-sandbox
and --process-per-tab
, it would confuse the app when the switches were meant to be given to node-webkit, so App.argv
just filtered such switches (arguments' precedence were kept). You can get the switches to be filtered with App.filteredArgv
.
Available after node-webkit v0.3.2
Send the close
event to all windows of current app, if no window is blocking the close
event, then the app will quit after all windows have done shutdown. Use this method to quit an app will give windows a chance to save data.
Quit current app. This method will not send close
event to windows and app will just quit quietly.
Since v0.6.0
Clear the HTTP cache in memory and the one on disk. This method call is synchronized.
Following events can be listened by using App.on()
function, for more information on how to receive events, you can visit EventEmitter.
Since v0.3.2
Emitted when users opened a file with your app. For more on this, see Handling files and arguments.