Manifest format - composite/nw.js GitHub Wiki

๋ชจ๋“  ์•ฑ ํŒจํ‚ค์ง€์—๋Š” ๋ฐ˜๋“œ์‹œ package.json ๋ผ๋Š” ํŒŒ์ผ์ด ๋“ค์–ด๊ฐ€ ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” nw.js๊ฐ€ ์•ฑ์„ ์–ด๋–ป๊ฒŒ ์ปจํŠธ๋กค ํ•˜๊ณ  ๋ธŒ๋ผ์šฐ์ง•์„ ์ฒ˜๋ฆฌํ•˜๋Š”์ง€ ์ „๋‹ฌํ•˜๋Š” ์š”์†Œ๊ฐ€ ๋ฉ๋‹ˆ๋‹ค.

๋น ๋ฅธ ์‹œ์ž‘

{
  "main": "index.html",
  "name": "nw-demo",
  "description": "demo app of node-webkit",
  "version": "0.1.0",
  "keywords": [ "demo", "node-webkit" ],
  "window": {
    "title": "node-webkit demo",
    "icon": "link.png",
    "toolbar": true,
    "frame": false,
    "width": 800,
    "height": 500,
    "position": "mouse",
    "min_width": 400,
    "min_height": 200,
    "max_width": 800,
    "max_height": 600
  },
  "webkit": {
    "plugin": true
  }
}

๊ธฐ๋ณธ ํ˜•์‹

package.json ํŒŒ์ผ์˜ ํ˜•์‹์€ JSON ํ˜•์‹์„ ๋”ฐ๋ผ์•ผ ํ•ฉ๋‹ˆ๋‹ค.

ํ•„์ˆ˜ ํ•ญ๋ชฉ

๊ฐ ํŒจํ‚ค์ง€์—๋Š” ์•„๋ž˜ ํ•ญ๋ชฉ์— ํŒจํ‚ค์ง€ ์„ค๋ช… ํŒŒ์ผ์— ๋ฐ˜๋“œ์‹œ ๋“ค์–ด๊ฐ€์•ผ ํ•ฉ๋‹ˆ๋‹ค.

main

(string) nw.js๊ฐ€ ์‹œ์ž‘์‹œ ๋จผ์ € ํ‘œ์‹œํ•  ํŽ˜์ด์ง€๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.

์—ฌ๊ธฐ์— URL ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•˜๊ฑฐ๋‚˜ ๊ทธ๋ƒฅ ํŒŒ์ผ ์ด๋ฆ„(index.html ๋“ฑ)์„ ์ž…๋ ฅํ•˜๊ฑฐ๋‚˜, ์•„๋‹ˆ๋ฉด ๊ฒฝ๋กœ๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. (์ƒ๋Œ€ ๊ฒฝ๋กœ ์ง€์ • ์‹œ ๊ธฐ์ค€์€ package.json ํŒŒ์ผ์ž…๋‹ˆ๋‹ค.)

๋ฐ˜๋“œ์‹œ ์ฐธ๊ณ ํ•ด์•ผ ํ•  ์‚ฌํ•ญ์ด ์žˆ๋‹ค๋ฉด, ํŒŒ์ผ์ด๋ฆ„ ์ดํ›„์— ํŒŒ๋ผ๋ฏธํ„ฐ๊ฐ€ ๋“ค์–ด๊ฐ€๋ฉด(index.html?foo=bar ๋“ฑ) ์•ˆ๋ฉ๋‹ˆ๋‹ค. ์ด์œ ๋Š” URL ๋ฐฉ์‹์ด ์•„๋‹ ๊ฒฝ์šฐ ์ˆœ์ˆ˜ ํŒŒ์ผ ๊ฒฝ๋กœ๋กœ ์ง€์ •ํ•˜๊ฒŒ ๋˜๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. (์˜ˆ๋ฅผ ๋“ค๋ฉด, index.html?foo=bar/baz ๊ฒฝ๋กœ๋Š” named index.html?foo=bar ๋””๋ ‰ํ„ฐ๋ฆฌ์˜ baz ํŒŒ์ผ๋กœ ๊ฐ„์ฃผ๋ฉ๋‹ˆ๋‹ค.) ์ด๋กœ ์ธํ•ด ๋œปํ•˜์ง€ ์•Š์€ ๊ฒฝ๋กœ ์„ค์ •์ด ๋  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ๋งŒ์•ฝ ๋‚ด๋ถ€ ๊ฒฝ๋กœ์— ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ๋ณด๋‚ด๊ณ  ์‹ถ๋‹ค๋ฉด, [์•ฑ ํ”„๋กœํ† ์ฝœ](App protocol) ์„ ์ด์šฉํ•œ URL ๋ฐฉ์‹์œผ๋กœ ์ •์˜ํ•˜์„ธ์š”.

name

(string) ํŒจํ‚ค์ง€๋ฅผ ์‹๋ณ„ํ•  ์ด๋ฆ„์ž…๋‹ˆ๋‹ค. ๋ฐ˜๋“œ์‹œ ์œ ์ผํ•ด์•ผ ํ•˜๋ฉฐ, ์†Œ๋ฌธ์ž์™€ ์ˆซ์ž๋กœ ๊ณต๋ฐฑ์ด ์—†์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ".", "_", "-" ๋ฌธ์ž๋„ ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ์œผ๋ฉฐ ์ด ์™ธ ๋ฌธ์ž๋Š” ๋ฌด์‹œ๋ฉ๋‹ˆ๋‹ค.

name ํ•ญ๋ชฉ์€ ๋ฐ˜๋“œ์‹œ nw.js ๋กœ๋ถ€ํ„ฐ ์ „์—ญ์œผ๋กœ ์œ ์ผํ•ด์•ผ ์•ฑ ๋ฐ์ดํ„ฐ๊ฐ€ name ํ•ญ๋ชฉ ํด๋”๋กœ ์ค‘๋ณต ์—†์ด ์ €์žฅ๋ฉ๋‹ˆ๋‹ค.

๊ธฐ๋Šฅ ์กฐ์ • ํ•ญ๋ชฉ

ํ•ด๋‹น ํ•ญ๋ชฉ๋“ค์€ nw.js ์—์„œ ๋ฉ”์ธ ์œˆ๋„์šฐ๋ฅผ ์ œ์–ดํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์ œ๊ณตํ•˜๋Š” ํ•ญ๋ชฉ๋“ค์ž…๋‹ˆ๋‹ค.

nodejs

(boolean) nodejs ํ•ญ๋ชฉ์„ false ๋กœ ์ง€์ • ์‹œ ์•ฑ ๋‚ด์— node.js ๊ธฐ๋Šฅ์„ ์ œ๊ฑฐํ•ฉ๋‹ˆ๋‹ค.

node-main

v0.3.1 ๋ถ€ํ„ฐ ์ง€์›

(string) node.js ์Šคํฌ๋ฆฝํŠธ ํŒŒ์ผ์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” Node ์ปจํ…์ŠคํŠธ ์ƒ์—์„œ ์ตœ์ดˆ๋กœ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. ์ด ์Šคํฌ๋ฆฝํŠธ๋Š” ๋ณดํ†ต node.js ๋ฐ”์ด๋„ˆ๋ฆฌ์™€ ๊ฐ™์€ ๋Ÿฐํƒ€์ž„ ํ™˜๊ฒฝ์—์„œ ๋™์ž‘๋˜๋Š”๋ฐ, v0.3.3 ๋ถ€ํ„ฐ๋Š” ์œˆ๋„์šฐ ์ดˆ๊ธฐํ™” ์ „์— ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์—ฌ๊ธฐ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

single-instance

๊ธฐ๋ณธ์ ์œผ๋กœ nw.js ์•ฑ์€ ํŒจํ‚ค์ง€๋‹น ํ•œ ์ธ์Šคํ„ด์Šค๋งŒ ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ฆ‰, ์ค‘๋ณต ์‹คํ–‰์„ ํ—ˆ์šฉํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค([์•ฑ์„ ํŒจํ‚ค์ง•ํ•˜๊ณ  ๋ฐฐํฌํ•˜๊ธฐ](How to package and distribute your apps) ํ™”๋ฉด์„ ์ฐธ๊ณ ํ•˜์„ธ์š”.). ๋งŒ์•ฝ ํŒจํ‚ค์ง€ ํ•˜๋‚˜์— ์ค‘๋ณต ์‹คํ–‰์„ ํ—ˆ์šฉํ•˜๊ณ ์ž ํ•œ๋‹ค๋ฉด ์ด ํ•ญ๋ชฉ์„ false๋กœ ์ง€์ •ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. v0.10.0-rc1 ๋ฒ„์ „๋ถ€ํ„ฐ๋Š” ํŒจํ‚ค์ง€๊ฐ€ ํ’€๋ฆฐ ํด๋”๋ฅผ ํ†ตํ•ด ์‹คํ–‰ํ•˜์—ฌ๋„ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค.

window

(object) ์œˆ๋„์šฐ ํ™”๋ฉด์„ ์ œ์–ดํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. Window ํ•˜์œ„ํ•ญ๋ชฉ ์„ ์ฐธ๊ณ ํ•˜์„ธ์š”.

webkit

(object) ์›นํ‚ท ์—”์ง„์˜ ๊ธฐ๋Šฅ์„ ํ‚ค๊ฑฐ๋‚˜ ๋„๋Š” ๋ฐฉ๋ฒ•์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. WebKit ํ•˜์œ„ํ•ญ๋ชฉ ์„ ์ฐธ๊ณ ํ•˜์„ธ์š”.

user-agent

since v0.3.7

(string) HTTP ์š”์ฒญ์— ์‚ฌ์šฉํ•˜๋Š” User-Agent ํ•ญ๋ชฉ์„ ์ง€์ •ํ•œ ๊ฐ’์œผ๋กœ ๋ฎ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜ ์น˜ํ™˜์ž๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • %name: ๋งค๋‹ˆํŽ˜์ŠคํŠธ name ํ•ญ๋ชฉ์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.
  • %ver: ๋งค๋‹ˆํŽ˜์ŠคํŠธ์˜ ๊ฐ€๋Šฅํ•œ version ํ•ญ๋ชฉ์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.
  • %nwver: nw.js ๋ฒ„์ „์„ ๋ช…์‹œํ•ฉ๋‹ˆ๋‹ค.
  • %webkit_ver: ์›นํ‚ท ์—”์ง„ ๋ฒ„์ „์„ ๋ช…์‹œํ•ฉ๋‹ˆ๋‹ค.
  • %osinfo: ๋ธŒ๋ผ์šฐ์ €์˜ ์‚ฌ์šฉ์ž ์—์ด์ „ํŠธ์— ๋‚˜ํƒ€๋‚˜๋Š” OS์™€ CPU ์ข…๋ฅ˜๋ฅผ ์—ด๊ฑฐํ•˜๋Š” ๋ฐฉ์‹๊ณผ ๋™์ผํ•˜๊ฒŒ ๋ช…์‹œํ•ฉ๋‹ˆ๋‹ค.

node-remote

since v0.3.7

(string) ์›๊ฒฉ์ƒ์˜ ํŽ˜์ด์ง€์—์„œ node ๊ธฐ๋Šฅ์„ ํ—ˆ์šฉํ•  ํ•ญ๋ชฉ์„ ์ •์˜ํ•˜๋Š” ํ•˜๋ชฉ์ž…๋‹ˆ๋‹ค. ๋ฐ˜๋“œ์‹œ ํ•ด๋‹น ํ•ญ๋ชฉ์— ์‚ฌ์ดํŠธ๊ฐ€ ํฌํ•จ๋˜์–ด์•ผ ํ•ด๋‹น ํŽ˜์ด์ง€ ์•ˆ์˜ node ๊ธฐ๋Šฅ์ด ์ž‘๋™๋ฉ๋‹ˆ๋‹ค. ์ด ํ˜•์‹์€ "ํ”„๋ก์‹œ ๊ฑด๋„ˆ๋›ฐ๊ธฐ ๊ทœ์น™" ํ˜•์‹๊ณผ ๋™์ผํ•ฉ๋‹ˆ๋‹ค.

์ด ๊ทœ์น™ ์„ธํŠธ๋Š” , ๋˜๋Š” ; ๋ฌธ์ž๋กœ ๋ณต์ˆ˜๋ฅผ ๊ตฌ๋ถ„ํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์€ ๊ทœ์น™ ์ •์˜๊ฐ€ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

  // (1) [ URL_SCHEME "://" ] HOSTNAME_PATTERN [ ":" <port> ]
  //
  //   HOSTNAME_PATTERN ์— ์ผ์น˜ํ•˜๋Š” ๋ชจ๋“  ํ˜ธ์ŠคํŠธ ์ด๋ฆ„.
  //
  //   ์˜ˆ์ œ:
  //     "foobar.com", "*foobar.com", "*.foobar.com", "*foobar.com:99",
  //     "https://x.*.y.com:99"
  //
  // (2) "." HOSTNAME_SUFFIX_PATTERN [ ":" PORT ]
  //
  //   ๋„๋ฉ”์ธ ์ ‘๋ฏธ์‚ฌ์™€ ๋งค์นญ
  //
  //   Examples:
  //     ".google.com", ".com", "http://.google.com"
  //
  // (3) [ SCHEME "://" ] IP_LITERAL [ ":" PORT ]
  //
  //   URL ์ฃผ์†Œ์— IP ์ฃผ์†Œ ๋งค์นญ
  //
  //   ์‹ค์งˆ์ ์œผ๋กœ (1)์˜ ๋ฐฉ๋ฒ•๊ณผ ๋น„์Šทํ•˜์ง€๋งŒ,
  //   IP ์ฃผ์†Œ ๊ตฌ์กฐ๋ฅผ ํ‘œ์ค€ํ™”ํ•˜์—ฌ ๊ฒ€์‚ฌํ•œ๋‹ค๋Š” ์ ์—์„œ ๋‹ค๋ฆ…๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด,
  //   "[0:0:0::1]" ์ด๋ผ๊ณ  ์ž…๋ ฅ ์‹œ IPv6 ํ‘œ์ค€ํ™”์— ์˜ํ•ด
  //   "[::1]" ์ด ๋“ค์–ด์™€๋„ ๋‚ด๋ถ€์ ์œผ๋กœ ์ˆ˜์šฉํ•ด ์ค๋‹ˆ๋‹ค.
  //
  //   Examples:
  //     "127.0.1", "[0:0::1]", "[::1]", "http://[::1]:99"
  //
  // (4)  IP_LITERAL "/" PREFIX_LENGHT_IN_BITS
  //
  //   IP ์ฃผ์†Œ์™€ ์ง€์ •๋œ ๋ฒ”์œ„๋ฅผ ๊ฒ€์‚ฌํ•˜๋Š” ์‹์ž…๋‹ˆ๋‹ค.
  //   IP ์ฃผ์†Œ๋Š” CIDR ๋ฒ”์œ„ ํ‘œ์ค€์— ์˜ํ•ด ๊ฒ€์‚ฌ๋ฉ๋‹ˆ๋‹ค.
  //
  //   Examples:
  //     "192.168.1.1/16", "fefe:13::abc/33".
  //
  // (5)  "<local>"
  //
  //   ๋‚ด๋ถ€ ์ฃผ์†Œ์ธ์ง€ ๊ฒ€์‚ฌํ•ฉ๋‹ˆ๋‹ค. "<local>" ์ด๋ผ ํ•จ์€,
  //   ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ฃผ์†Œ๊ฐ€ ๋ชจ๋‘ ๋งค์นญ๋ฉ๋‹ˆ๋‹ค: "127.0.0.1", "::1", "localhost".

chromium-args

since v0.4.0

(๋ฌธ์ž์—ด) ํฌ๋กœ๋ฏธ์›€(์ปจํ…ํŠธ ์‰˜)์˜ ๋ช…๋ น ์ธ์ž๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. Specify chromium (content shell) command line arguments. It will be useful if you want to distribute the app with some custom chromium args. For example, if you want to disable the GPU accelerated video display, just add "chromium-args" : "--disable-accelerated-video". If you want to add multiple arguments, separate each two arguments by space. This field can take a number of flags in one argument as well, via enclosing them in single quotation marks.

A list of Chromium's command line arguments is available at http://peter.sh/experiments/chromium-command-line-switches/

js-flags

since v0.4.1

(string) Specify the flags passed to JS engine(v8). e.g. turn on Harmony Proxies and Collections feature:

{
  "name": "nw-demo",
  "main": "index.html",
  "js-flags": "--harmony_proxies --harmony_collections"
}

inject-js-start / inject-js-end

since v0.9.0 and v0.8.5

(string) a local filename, relative to the application path, used to specify a JavaScript file to inject to the window. inject-js-start: The injecting JavaScript code is to be executed after any files from css, but before any other DOM is constructed or any other script is run; inject-js-end: The injecting JavaScript code is to be executed after the document object is loaded, before onload event is fired. This is mainly to be used as an option of Window.open() to inject JS in a new window.

additional_trust_anchors

since v0.11.1

containing a list of PEM-encoded certificates (i.e. "-----BEGIN CERTIFICATE-----\n...certificate data...\n-----END CERTIFICATE-----\n").
These certificates are used as additional root certificates for validation, to allow connecting to services using a self-signed certificate or certificates issued by custom CAs.

snapshot

since v0.4.2

(string) Specify the path to the snapshot file to be loaded with the application. The snapshot file contains compiled code of your application. See Protect JavaScript source code with v8 snapshot.

dom_storage_quota

since v0.6.1

(int) Number of mega bytes for the quota of the DOM storage. The suggestion is to put double the value you want.

no-edit-menu

since v0.7.3

(boolean) whether the default Edit menu should be disabled on Mac OS X. The default value is false. Only effective on Mac OS X. This is a workaround for a feature request and is expected to be replaced by something else soon

Window Subfields

title

(string) the default title of window created by node-webkit, it's very useful if you want to show your own title when the app is starting.

width/height

(int) the initial width/height of the main window.

toolbar

(boolean) should the navigation toolbar be showed.

icon

(string) path to window's icon

position

(string) be null or center or mouse, controls where window will be put

min_width/min_height

(int) minimum width/height of window

max_width/max_height

(int) maximum width/height of window

as_desktop

(boolean) show as desktop background window under X11 environment

resizable

(boolean) whether window is resizable (available after node-webkit v0.3.0)

always-on-top

since v0.3.4

(boolean) whether the window should always stay on top of other windows.

visible-on-all-workspaces

since v0.11.3

(boolean) whether the window should be visible on all workspaces simultaneously (on platforms that support multiple workspaces, currently Mac OS X and Linux).

fullscreen

since v0.3.0

(boolean) whether window is fullscreen

show_in_taskbar

since v0.9.2

(boolean) whether the window is shown in taskbar or dock. The default is true.

frame

since v0.3.0

(boolean) specify it to false to make the window frameless

show

since v0.3.0

(boolean) specify it to false if you want your app to be hidden on startup

kiosk

since v0.3.1

(boolean) whether to use Kiosk mode. In Kiosk mode, the app will be fullscreen and try to prevent users from leaving the app, so you should remember to provide a way in app to leave Kiosk mode. This mode is mainly used for presentation on public displays

transparent

since v0.11.2

(boolean) whether to turn on transparent window mode. The default is false.

_control the transparency with rgba background value in CSS. Use command line argument --disable-transparency to disable this feature completely. There is experimental support for "click-through" on the transparent region: add --disable-gpu argument to the command line. See the discussion here: https://github.com/rogerwang/node-webkit/issues/132 _

WebKit Subfields

The following fields require node-webkit >= v0.3.0.

plugin

(boolean) whether to load external browser plugins like Flash, default to false.

java

(boolean) whether to load Java applets, default to false.

page-cache

(boolean) whether to enable page cache, default to false.

Other Fields

The Packages/1.0 standard specifies many other fields package.json should provide. currently we don't make use of them, but you provide them still.

description

a brief description of the package. By convention, the first sentence (up to the first ". ") should be usable as a package title in listings.

version

a version string conforming to the Semantic Versioning requirements.

keywords

an Array of string keywords to assist users searching for the package in catalogs.

maintainers

Array of maintainers of the package. Each maintainer is a hash which must have a "name" property and may optionally provide "email" and "web" properties. For example:

"maintainers":[ {
   "name": "Bill Bloggs",
   "email": "[email protected]",
   "web": "http://www.bblogmedia.com",
}]

contributors

an Array of hashes each containing the details of a contributor. Format is the same as for author. By convention, the first contributor is the original author of the package.

bugs

URL for submitting bugs. Can be mailto or http.

licenses

array of licenses under which the package is provided. Each license is a hash with a "type" property specifying the type of license and a url property linking to the actual text. If the license is one of the official open source licenses the official license name or its abbreviation may be explicated with the "type" property. If an abbreviation is provided (in parentheses), the abbreviation must be used.

"licenses": [
   {
       "type": "GPLv2",
       "url": "http://www.example.com/licenses/gpl.html",
   }
]

repositories

Array of repositories where the package can be located. Each repository is a hash with properties for the "type" and "url" location of the repository to clone/checkout the package. A "path" property may also be specified to locate the package in the repository if it does not reside at the root. For example:

"repositories": [
       {
            "type": "git", 
            "url": "http://github.com/example.git",
            "path": "packages/mypackage"
       }
]
โš ๏ธ **GitHub.com Fallback** โš ๏ธ