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 ํ์์ ๋ฐ๋ผ์ผ ํฉ๋๋ค.
๊ฐ ํจํค์ง์๋ ์๋ ํญ๋ชฉ์ ํจํค์ง ์ค๋ช ํ์ผ์ ๋ฐ๋์ ๋ค์ด๊ฐ์ผ ํฉ๋๋ค.
(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 ๋ฐฉ์์ผ๋ก ์ ์ํ์ธ์.
(string) ํจํค์ง๋ฅผ ์๋ณํ ์ด๋ฆ์ ๋๋ค. ๋ฐ๋์ ์ ์ผํด์ผ ํ๋ฉฐ, ์๋ฌธ์์ ์ซ์๋ก ๊ณต๋ฐฑ์ด ์์ด์ผ ํฉ๋๋ค. ".", "_", "-" ๋ฌธ์๋ ๋ค์ด๊ฐ ์ ์์ผ๋ฉฐ ์ด ์ธ ๋ฌธ์๋ ๋ฌด์๋ฉ๋๋ค.
name ํญ๋ชฉ์ ๋ฐ๋์ nw.js ๋ก๋ถํฐ ์ ์ญ์ผ๋ก ์ ์ผํด์ผ ์ฑ ๋ฐ์ดํฐ๊ฐ name ํญ๋ชฉ ํด๋๋ก ์ค๋ณต ์์ด ์ ์ฅ๋ฉ๋๋ค.
ํด๋น ํญ๋ชฉ๋ค์ nw.js ์์ ๋ฉ์ธ ์๋์ฐ๋ฅผ ์ ์ดํ๋ ๋ฐฉ๋ฒ์ ์ ๊ณตํ๋ ํญ๋ชฉ๋ค์
๋๋ค.
(boolean) nodejs ํญ๋ชฉ์ false ๋ก ์ง์ ์ ์ฑ ๋ด์ node.js ๊ธฐ๋ฅ์ ์ ๊ฑฐํฉ๋๋ค.
v0.3.1 ๋ถํฐ ์ง์
(string) node.js ์คํฌ๋ฆฝํธ ํ์ผ์ ์ง์ ํฉ๋๋ค. ์ด๋ Node ์ปจํ
์คํธ ์์์ ์ต์ด๋ก ์คํ๋ฉ๋๋ค. ์ด ์คํฌ๋ฆฝํธ๋ ๋ณดํต node.js ๋ฐ์ด๋๋ฆฌ์ ๊ฐ์ ๋ฐํ์ ํ๊ฒฝ์์ ๋์๋๋๋ฐ, v0.3.3 ๋ถํฐ๋ ์๋์ฐ ์ด๊ธฐํ ์ ์ ์คํฌ๋ฆฝํธ๊ฐ ์คํ๋ฉ๋๋ค. ์์ธํ ๋ด์ฉ์ ์ฌ๊ธฐ๋ฅผ ์ฐธ๊ณ ํ์ธ์.
๊ธฐ๋ณธ์ ์ผ๋ก nw.js ์ฑ์ ํจํค์ง๋น ํ ์ธ์คํด์ค๋ง ํ์ฉํฉ๋๋ค. ์ฆ, ์ค๋ณต ์คํ์ ํ์ฉํ์ง ์์ต๋๋ค([์ฑ์ ํจํค์งํ๊ณ ๋ฐฐํฌํ๊ธฐ](How to package and distribute your apps) ํ๋ฉด์ ์ฐธ๊ณ ํ์ธ์.). ๋ง์ฝ ํจํค์ง ํ๋์ ์ค๋ณต ์คํ์ ํ์ฉํ๊ณ ์ ํ๋ค๋ฉด ์ด ํญ๋ชฉ์ false๋ก ์ง์ ํ๋ฉด ๋ฉ๋๋ค.
v0.10.0-rc1 ๋ฒ์ ๋ถํฐ๋ ํจํค์ง๊ฐ ํ๋ฆฐ ํด๋๋ฅผ ํตํด ์คํํ์ฌ๋ ์ ์ฉ๋ฉ๋๋ค.
(object) ์๋์ฐ ํ๋ฉด์ ์ ์ดํ๋ ๋ฐฉ๋ฒ์ ์ ์ํฉ๋๋ค. Window ํ์ํญ๋ชฉ ์ ์ฐธ๊ณ ํ์ธ์.
(object) ์นํท ์์ง์ ๊ธฐ๋ฅ์ ํค๊ฑฐ๋ ๋๋ ๋ฐฉ๋ฒ์ ์ ์ํฉ๋๋ค. WebKit ํ์ํญ๋ชฉ ์ ์ฐธ๊ณ ํ์ธ์.
since v0.3.7
(string) HTTP ์์ฒญ์ ์ฌ์ฉํ๋ User-Agent ํญ๋ชฉ์ ์ง์ ํ ๊ฐ์ผ๋ก ๋ฎ์ต๋๋ค.
์๋ ์นํ์๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.
-
%name: ๋งค๋ํ์คํธnameํญ๋ชฉ์ ๋ํ๋ ๋๋ค. -
%ver: ๋งค๋ํ์คํธ์ ๊ฐ๋ฅํversionํญ๋ชฉ์ ๋ํ๋ ๋๋ค. -
%nwver: nw.js ๋ฒ์ ์ ๋ช ์ํฉ๋๋ค. -
%webkit_ver: ์นํท ์์ง ๋ฒ์ ์ ๋ช ์ํฉ๋๋ค. -
%osinfo: ๋ธ๋ผ์ฐ์ ์ ์ฌ์ฉ์ ์์ด์ ํธ์ ๋ํ๋๋ OS์ CPU ์ข ๋ฅ๋ฅผ ์ด๊ฑฐํ๋ ๋ฐฉ์๊ณผ ๋์ผํ๊ฒ ๋ช ์ํฉ๋๋ค.
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".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/
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"
}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.
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.
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.
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.
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
(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.
(int) the initial width/height of the main window.
(boolean) should the navigation toolbar be showed.
(string) path to window's icon
(string) be null or center or mouse, controls where window will be put
(int) minimum width/height of window
(int) maximum width/height of window
(boolean) show as desktop background window under X11 environment
(boolean) whether window is resizable (available after node-webkit v0.3.0)
since v0.3.4
(boolean) whether the window should always stay on top of other windows.
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).
since v0.3.0
(boolean) whether window is fullscreen
since v0.9.2
(boolean) whether the window is shown in taskbar or dock. The default is true.
since v0.3.0
(boolean) specify it to false to make the window frameless
since v0.3.0
(boolean) specify it to false if you want your app to be hidden on startup
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
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 _
The following fields require node-webkit >= v0.3.0.
(boolean) whether to load external browser plugins like Flash, default to false.
(boolean) whether to load Java applets, default to false.
(boolean) whether to enable page cache, default to false.
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.
a brief description of the package. By convention, the first sentence (up to the first ". ") should be usable as a package title in listings.
a version string conforming to the Semantic Versioning requirements.
an Array of string keywords to assist users searching for the package in catalogs.
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",
}]
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.
URL for submitting bugs. Can be mailto or http.
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",
}
]
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"
}
]