Skip to content
Cong Liu edited this page Mar 30, 2016 · 9 revisions

NOTE: some content in this wiki applies only to 0.12 and earlier versions. For official documentation on 0.13 and later, see http://docs.nwjs.io

This feature is deprecated since 0.13.0. See migration note for details.

since v0.7.0

The app protocol is defined like http protocol: app://<host>/path. The host part is essential. You can define it to anything you want. The root of path refers to the application's directory, which is the directory where the manifest file resides.

It's provided for the ease of migrating files from your web site, e.g. repackage your web site as a node-webkit application.

Regarding security, it's treated as local file protocol and has access to Node functionality.

Example:

If you use absolute paths in the project and move the project directory to different path, you can just set a global 'app://xyz' in package's manifest.json to avoid of path modification in each file. Well, if you only use relative paths, you don't need to use it.

 {
  "name": "ParleysDesktop",
  "main": "app://whatever/index.html",
  "window": {
    "toolbar": true,
    "frame": true,
    "width": 1000,
    "height": 800,
    "position": "mouse",
    "min_width": 400,
    "min_height": 200,
    "max_width": 8000,
    "max_height": 8000
  }
 }
Clone this wiki locally