Expand description
App bindings providing application control, access to command-line arguments,
working directory, paths for the browser data folders, cache control, origin control,
global keyboard hotkey registration, proxy control, underlaying browser control and
package.json manifest access.
Functions
- Add an entry to the whitelist used for controlling cross-origin access. Suppose you want to allow HTTP redirecting from github.com to the page of your app, use something like this:
- Get the filtered command line arguments when starting the app. In NW.js, some command line arguments are used by NW.js, which should not be interested of your app. App.argv will filter out those arguments and return the ones left. You can get filtered patterns from app::filtered_argv and the full arguments from app::full_argv.
- Mark the Application cache group specified by
manifest_urlobsolete. This method call is synchronized. - Clear the HTTP cache in memory and the one on disk. This method call is synchronized.
- 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.
- Crashes the browser process to test the Crash dump feature.
- Crashes the renderer process to test the Crash dump feature.
- Get the application’s data path in user’s directory.
- Experimental
- Get a list of patterns of filtered command line arguments used by app::argv(). By default, following patterns are used to filter the arguments:
- Get all the command line arguments when starting the app. The return values contains the arguments used by NW.js, such as –nwapp, –remote-debugging-port etc.
- Get the JSON object of the manifest file.
- Quit current app. This method will not send
closeevent to windows and app will just quit quietly. - Register a global keyboard shortcut (also known as system-wide hot key) to the system.
- Remove an entry from the whitelist used for controlling cross-origin access. See nw_sys::app::add_origin_access_whitelist_entry().
- Deprecated: Set the directory where the minidump file will be saved on crash. For more information, see Crash dump.
- Set the proxy config which the web engine will be used to request network resources or PAC url to detect proxy automatically.
- Get the directory where the application starts. The application will change the current directory to where the package files reside after start.
- Unregisters a global keyboard shortcut.
- Experimental