diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..0514222a09 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,9 @@ +Read the following before submitting your issue, thank you. + +* Use our mailing list to ask questions which don't imply bug or feature request: https://groups.google.com/forum/#!forum/nwjs-general +* State which version are you using +* State which OS version are you running with +* Provide a reproducible case if possible +* Attach the crash dump file if it's a crash: http://docs.nwjs.io/en/latest/For%20Developers/Understanding%20Crash%20Dump/#find-minidump-file + +Issues meet the checklist above will be processed before those don't. diff --git a/AUTHORS b/AUTHORS index 1f41d665ef..dd1e538b91 100644 --- a/AUTHORS +++ b/AUTHORS @@ -25,7 +25,7 @@ Fabrice Weinberg Lv Kaiyang Lukas Benes Lithare Emileit -Jefry Tedjokusumo +Jefry Tedjokusumo from V-cube Global Services ; Wu Haojian Bas Wegh Joachim Bauch diff --git a/CHANGELOG.md b/CHANGELOG.md index ae82e673f6..98d50744aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,217 @@ +0.13.4 / 04-08-2016 +=================== +- Update Chromium to 49.0.2623.112 +- Fix: webview local file issue [(#4668)](https://github.com/nwjs/nw.js/issues/4668) +- Fix: Custom app icon with incorrect size under volume mixer [(#4649)](https://github.com/nwjs/nw.js/issues/4649) +- Fix: process Event: 'uncaughtException' not working in 0.13 [(#4679)](https://github.com/nwjs/nw.js/issues/4679) +- [docs] data-path -> user-data-dir; --disable-raf-throttling +- [docs] Clarify files can be safely removed during packaging [(#4676)](https://github.com/nwjs/nw.js/issues/4676) + +0.13.3 / 04-04-2016 +=================== +- Update Node.js to 5.10.0 +- support --disable-raf-throttling to enable RequestAnimationFrame for background apps (#4664) +- Fix: App will crash if CFBundleIdentifier in plist longer than 30 chrs (#4638) +- Fix: Crash when open a pdf file in webview. (#4644) +- Fix: [WIN] window restore size is changed when aero glass is on (#4323) +- Fix: inject_js_end not working on remote pages (#4656) +- Fix: Queries were sent to Google to update plugin metadata (#4669) +- Fix: [WIN] Window size includes title bar (#4627) +- Fix: Crash when bg-script calls nw.Window.get() (#4368) +- Fix: Disabled menu item, still accessible via hotkey (#2261) +- Fix: Unable to turn off / disable debug.log (#4637) +- [docs] data-path -> user-data-dir +- [docs] add link to buildbot +- [docs] using flash plugin +- [docs] location of nwjc and chromedriver + +0.13.2 / 03-29-2016 +=================== +- Update Chromium to 49.0.2623.110 +- Fix: crashes in CloseWatcher::CallbackAndDie sometimes (#4636) +- Fix: nwsaveas is ignored when nwworkingdir is specified in nw13 (#4630) +- Fix: "Inspect" Entry in Non-SDK PDF Viewer's Context Menu (#4642) + +0.13.1 / 03-25-2016 +=================== +- Update Chromium to 49.0.2623.108 +- Fix: Performance degradation in constructing typed array from node buffer (#4614) + +0.13.0 / 03-23-2016 +=================== +- Fix: [OSX] Cmd-Q does not pass true as the first argument to the event after createMacBuiltin() (#4580) +- Fix: Window event 'move'/'resize' callback arguments undefined (#4610) +- [docs] Update Command Line options with full list +- [docs] List Chrome Extension APIs + +0.13.0-rc4 / 03-21-2016 +======================= +- Update Node.js to 5.9.0 +- Fix: [WIN] unable to launch on XP 64bit system (#4600) +- Fix: Crash when using `additional_trust_anchors` +- Fix: Screen capture does not work in remote domain (#4579) +- Fix: webview events not firing in remote page (#4590) +- Fix: Crash when adding folder to workspace in devtools (#4602) +- Fix: [OSX] Crash when using nw.Menu with chrome.identity.launchWebAuthFlow (#4591) +- Fix: Crash when trying to open tabbed browser window (#4587, #4540) +- Fix: Only top left corner of window icon is shown (#4581) +- Fix: [OSX] Crash dumps doesn't match hashes of symbol files (#4450) +- Fix: Crash on promise rejection handler (#4577) +- Fix: Menu.popup blocks program (#4593) +- Fix: [OSX] Cmd-Q does not pass true as the first argument to the event (#4580) +- Fix: capturePage always return PNG (#4609) +- [WIN] dump node.dll symbols +- Remove context menu of notification (#4598) +- Remove settings button of notification (#4582) +- [docs] update crash dump location +- [docs] add link for enable logging in FAQ +- [docs] Reorder the navigation pane (#4576) +- [docs] Multiple language resources in SDK build + +0.13.0-rc3 / 03-15-2016 +======================= +- Enable auth password dialog +- Enable notification permission for all origin (#4521, #4533) +- Support chrome.contentSettings API (#4521) +- Fix: wrong version and info for Pepper Flash plugin in registry (#4530) +- Fix: [WIN] fix: window title and icon not shown +- Fix: [WIN] start up fail where crashpad path is not found +- Fix: nwjs 0.13.0 showed as chromium in taskbar on Linux (#4537) +- [docs] more info on bg-script +- [docs] transparecy needs frameless + +0.13.0-rc2 / 03-11-2016 +======================= +- Update Chromium to 49.0.2623.87 +- Update Node.js to 5.8.0 +- Ship .pak files for non-English languages in SDK build +- Build ffmpeg as Dll (#4492) +- Disable notification of screen sharing (#4484) +- Migrate indexed db files in user data dir (#4469) +- Migrate local storage files for app protocol in user data dir (#4527) +- Fix: node-main is broken (#4495) +- Fix: app asks for confidential information for NWJS Safe Storage in keychain (#4458) +- Fix: crash when navigate in some sites (#4422) +- Fix: Use window subfields in manifest for newly created windows (#4221) +- Fix: After press the “command+h” to minimize, but unable to recover (#4296) +- Fix: crashpad handler error in windows (debug build unable to start) +- Fix: Window title still shows with frame set to false on OSX (#4507) +- Fix: The 'width' and 'height' in the manifest file does not work properly on OSX (#4493) +- Fix: crash in chrome.app.window.create(url) without 2nd argument +- Fix: nw.Window broken on 0.13.0-rc1 with --mixed-context (#4498) +- Fix: Make menu callback work after navigation (#4313) +- Fix: Show menubar menus from top-left anchor (#4473) +- [docs] add 'Customize menubar' (#4416) + +0.13.0-rc1 / 03-03-2016 +======================= +- Update Chromium to 49.0.2623.75 +- Update Node.js to 5.7.0 +- Add `nw.Screen.DesktopCaptureMonitor.registerStream()` for using stream id in `getUserMedia()` (#4459) +- Fix: Wrong "restore" window size after click on the app in the taskbar on windows 10 (#4323) +- [docs] chromedriver: a better way to arguments of nw app + +0.13.0-beta7 / 02-25-2016 +========================= +- Update Chromium to 48.0.2564.116 +- Support loading devtools in/for webview by adding webview.showDevTools (#4411) +- Fully support for devtools extensions (#612) +- support loading local file in webview (#4425) +- Fix: add URL scheme support for MAC (#4240) +- Fix: alert/prompt dialog with nwjs style (#4413) +- Fix: menubar button not found when navigate to another menu (#4371) + +0.13.0-beta6 / 02-17-2016 +========================= +- Update Chromium to 48.0.2564.109 +- Update Node.js to 5.6.0 +- support controlling window with external page +- Fix: enable self extraction (#4071) +- Fix: crash when using native modules in OSX (#4338) +- Fix: FileReader not working (#4399) +- Fix: console tab with DevTools jail not working until switch frame manually +- Fix: OSX menu support broken (#4374) +- Fix: JavaScript dialogs text (#4190) +- Fix: Typo: rename `App.(un)registerGlobalHotkey` to `App.(un)registerGlobalHotKey` +- Fix: Window.zoomLevel changes all windows (#4352) +- Fix: avoid polluting global namespace with 'path' etc. (#4350) +- add URL scheme support for MAC (#4240) +- support 'new_instance' option for Window.open +- support native modules built by node-gyp +- [docs] update for new_instance etc + +0.13.0-beta5 / 02-01-2016 +========================= +- Update Chromium to 48.0.2564.97 +- Add back transparency support which is missing in beta4 +- support program args in chromedriver +- port App.open argument (#4289) +- support webkit.plugin field in manifest +- Fix package script to support Win XP (#4181) +- [OSX] disable double tap with 2 fingers by default and add option for it (#4249) +- Fix: support window id in Window.open() (#4268) +- Fix: permission for webRequest API (#4220) +- rename 'inject-js-start' with 'inject_js_start' and add it to Window.open options (#4286) +- rename 'always-on-top' with 'always_on_top', and 'visible-on-all-workspaces' with 'visible_on_all_workspaces' +- Fix: infinite loop in nw.Window.close(true) (#4171) +- Fix: Window title not changed by setting document.title (#3589) +- Fix: startup slow because of scanning for invalid file name (#4303) +- Fix: [OSX] suppress warning when opening devtools +- Fix: conflict between promise rejection callbacks from Blink and Node (#4300) +- Fix: Taking heap snapshot crashes webkit (#3678) +- Fix: [OSX] App quits when closing window if window.show is false in manifest (#4187) +- Fix: crash when opening external links with browser in devtools (#4269, #4121) +- Fix: crash when opening external links with browser in print preview (#4270) +- Fix: cookies API (#4199) +- [docs] add enable-gcm +- [docs] add double_tap_to_zoom_enabled +- [docs] add FAQ for console.log +- [docs] Updated FAQ for AnuglarJS 2 + +0.13.0-beta4 / 01-18-2016 +========================= +- Update Chromium to 48.0.2564.82 +- Update Node.js to 5.4.1 +- [OSX] Fix process.nextTick in some cases +- [OSX] Fix hidden window title (#4186) +- ported nw.App.fullArgv +- Fix: nw.App.quit() does nothing when use JS file as main (#4227) + +0.13.0-beta3 / 01-13-2016 +========================= +- Fix: save as... dialog not working (#4142) +- Fix: app with hidden window will quit on start on osx +- Fix: chrome socket api permission in NW app (#4143) +- Fix: some Node core modules not working after close window (#4130, #4140) +- Fix: chrome.fileSystem.restoreEntry breaks retainID on app reload (#4150) +- Fix: oauth not working due to browser side naviagation (#4179, #4131, #4184) +- Fix: Exception in nw.dll when running native module serialport (#4152) +- Fix: window.open not loaded using node-remote (#4180) +- Fix: POST form not working on navigation +- Fix: nwjs Helper process not closed (#4118) +- Fix: NW.js doesn't quit if DevTools has opened once (#4164) +- Fix: window not closed when listen to 'close' event in another window (#4138) +- Fix: [WIN] debug build of 'payload' tool +- Fix: Crash when using devtools to view some source (#4121) +- Fix: nw.Window.get() returns null after navigation (#4157, #4007) +- Fix: requrie() function in the shim for nw12 compatibility (#4141) +- Fix: Reversed x and y in win.moveTo and win.moveBy (#4136) +- Accept array of matched patterns in node-remote (#4132) +- [doc] Added docs for win.navigation event +- [doc] Updated docs for single-instance +- [doc] add hint for document contribution +- [doc] update for Multiple Context mode +- [doc] For Users > Getting Started. Revise example 2 sample code to cater new NW.JS API for Menu +- [doc] update for Window.id + +0.13.0-beta2 / 12-31-2015 +========================= +- Fix: application window is opened out of the screen on Windows. + +0.13.0-beta1 / 12-30-2015 +========================= +- Most of nw.gui API ported + 0.12.3 / 07-31-2015 =================== - Support Mac App Store with the 'macappstore' flavor diff --git a/LICENSE b/LICENSE index 3a4009653d..08e563ecab 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ -Copyright (c) 2012-2014 Intel Corp -Copyright (c) 2012-2014 The Chromium Authors +Copyright (c) 2012-2016 Intel Corp +Copyright (c) 2012-2016 The Chromium Authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in th diff --git a/README.md b/README.md index 9c8facc379..9f15888388 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/nwjs/nw.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Official site: http://nwjs.io +Official documentation: http://docs.nwjs.io/ [Announcement](https://groups.google.com/d/msg/nwjs-general/V1FhvfaFIzQ/720xKVd0jNkJ) ## Introduction @@ -12,41 +13,35 @@ native applications with all Web technologies. It was created in the Intel Open Source Technology Center. -[Introduction to node-webkit (slides)](https://speakerdeck.com/u/zcbenz/p/node-webkit-app-runtime-based-on-chromium-and-node-dot-js) -[Creating Desktop Applications With node-webkit](http://strongloop.com/strongblog/creating-desktop-applications-with-node-webkit/) +[Introduction to node-webkit (slides)](https://speakerdeck.com/zcbenz/node-webkit-app-runtime-based-on-chromium-and-node-dot-js) +[Creating Desktop Applications With node-webkit](https://strongloop.com/strongblog/creating-desktop-applications-with-node-webkit/) [WebApp to DesktopApp with node-webkit (slides)](http://oldgeeksguide.github.io/presentations/html5devconf2013/wtod.html) [Essay on the history and internals of the project](http://yedingding.com/2014/08/01/node-webkit-intro-en.html) ## Features * Apps written in modern HTML5, CSS3, JS and WebGL. -* Complete support for [Node.js APIs](http://nodejs.org/api/) and all its [third party modules](https://npmjs.org). +* Complete support for [Node.js APIs](https://nodejs.org/api/) and all its [third party modules](https://www.npmjs.com/). * Good performance: Node and WebKit run in the same thread: Function calls are made straightforward; objects are in the same heap and can just reference each other; * Easy to package and distribute apps. * Available on Linux, Mac OS X and Windows ## Downloads -* **v0.12.3:** (Jul 31, 2015, based off of IO.js v1.2.0, Chromium 41.0.2272.76): [release notes](https://groups.google.com/d/msg/nwjs-general/hhXCS4aXGV0/TUQmcu5XDwAJ) - * Linux: [32bit](http://dl.nwjs.io/v0.12.3/nwjs-v0.12.3-linux-ia32.tar.gz) / [64bit](http://dl.nwjs.io/v0.12.3/nwjs-v0.12.3-linux-x64.tar.gz) - * Windows: [32bit](http://dl.nwjs.io/v0.12.3/nwjs-v0.12.3-win-ia32.zip) / [64bit](http://dl.nwjs.io/v0.12.3/nwjs-v0.12.3-win-x64.zip) - * Mac 10.7+: [32bit](http://dl.nwjs.io/v0.12.3/nwjs-v0.12.3-osx-ia32.zip) / [64bit](http://dl.nwjs.io/v0.12.3/nwjs-v0.12.3-osx-x64.zip) - -* **v0.13.0-alpha2:** (Jun 23, 2015, based off of IO.js v1.5.1, Chromium 43.0.2357.45): [release notes](https://groups.google.com/d/msg/nwjs-general/zeC6SedUSFY/BlumrYJeVHYJ) +* **v0.13.4:** (Apr 8, 2016, based off of Node.js v5.10.0, Chromium 49.0.2623.112): [release notes](http://nwjs.io/blog/v0.13.4/) **NOTE** You might want the **SDK build**. Please read the release notes - * Linux: [32bit](http://dl.nwjs.io/v0.13.0/alpha2/nwjs-v0.13.0-alpha2-linux-ia32.tar.gz) / [64bit](http://dl.nwjs.io/v0.13.0/alpha2/nwjs-v0.13.0-alpha2-linux-x64.tar.gz) - * Windows: [32bit](http://dl.nwjs.io/v0.13.0/alpha2/nwjs-v0.13.0-alpha2-win-ia32.zip) / [64bit](http://dl.nwjs.io/v0.13.0/alpha2/nwjs-v0.13.0-alpha2-win-x64.zip) - * Mac 10.7+: [32bit](http://dl.nwjs.io/v0.13.0/alpha2/nwjs-v0.13.0-alpha2-osx-ia32.zip) / [64bit](http://dl.nwjs.io/v0.13.0/alpha2/nwjs-v0.13.0-alpha2-osx-x64.zip) - -* **0.8.6:** (Apr 18, 2014, based off of Node v0.10.22, Chrome 30.0.1599.66) **If your native Node module works only with Node v0.10, then you should use node-webkit v0.8.x, which is also a maintained branch. [More info](https://groups.google.com/d/msg/nwjs-general/2OJ1cEMPLlA/09BvpTagSA0J)** -[release notes](https://groups.google.com/d/msg/nwjs-general/CLPkgfV-i7s/hwkkQuJ1kngJ) + * Linux: [32bit](http://dl.nwjs.io/v0.13.4/nwjs-v0.13.4-linux-ia32.tar.gz) / [64bit](http://dl.nwjs.io/v0.13.4/nwjs-v0.13.4-linux-x64.tar.gz) + * Windows: [32bit](http://dl.nwjs.io/v0.13.4/nwjs-v0.13.4-win-ia32.zip) / [64bit](http://dl.nwjs.io/v0.13.4/nwjs-v0.13.4-win-x64.zip) + * Mac 10.7+: [64bit](http://dl.nwjs.io/v0.13.4/nwjs-v0.13.4-osx-x64.zip) - * Linux: [32bit](http://dl.node-webkit.org/v0.8.6/node-webkit-v0.8.6-linux-ia32.tar.gz) / [64bit](http://dl.node-webkit.org/v0.8.6/node-webkit-v0.8.6-linux-x64.tar.gz) - * Windows: [win32](http://dl.node-webkit.org/v0.8.6/node-webkit-v0.8.6-win-ia32.zip) - * Mac: [32bit, 10.7+](http://dl.node-webkit.org/v0.8.6/node-webkit-v0.8.6-osx-ia32.zip) +* **v0.14.0-rc3:** (Apr 7, 2016, based off of Node.js v5.10.0, Chromium 50.0.2661.66): [release notes](http://nwjs.io/blog/v0.14.0-rc3/) + **NOTE** You might want the **SDK build**. Please read the release notes + * Linux: [32bit](http://dl.nwjs.io/v0.14.0-rc3/nwjs-v0.14.0-rc3-linux-ia32.tar.gz) / [64bit](http://dl.nwjs.io/v0.14.0-rc3/nwjs-v0.14.0-rc3-linux-x64.tar.gz) + * Windows: [32bit](http://dl.nwjs.io/v0.14.0-rc3/nwjs-v0.14.0-rc3-win-ia32.zip) / [64bit](http://dl.nwjs.io/v0.14.0-rc3/nwjs-v0.14.0-rc3-win-x64.zip) + * Mac 10.7+: [64bit](http://dl.nwjs.io/v0.14.0-rc3/nwjs-v0.14.0-rc3-osx-x64.zip) * **latest live build**: git tip version; build triggered from every git commit: http://dl.nwjs.io/live-build/ -* [Previous versions](https://github.com/rogerwang/node-webkit/wiki/Downloads-of-old-versions) +* [Previous versions](https://github.com/nwjs/nw.js/wiki/Downloads-of-old-versions) ###Demos and real apps You may also be interested in [our demos repository](https://github.com/zcbenz/nw-sample-apps) and the [List of apps and companies using nw.js](https://github.com/nwjs/nw.js/wiki/List-of-apps-and-companies-using-nw.js). @@ -92,11 +87,11 @@ Note: on OSX, the executable binary is in a hidden directory within the .app fil For more information on how to write/package/run apps, see: -* [How to run apps](https://github.com/rogerwang/node-webkit/wiki/How-to-run-apps) -* [How to package and distribute your apps](https://github.com/rogerwang/node-webkit/wiki/How-to-package-and-distribute-your-apps) -* [How to use Node.js modules in node-webkit](https://github.com/rogerwang/node-webkit/wiki/Using-Node-modules) +* [How to run apps](https://github.com/nwjs/nw.js/wiki/How-to-run-apps) +* [How to package and distribute your apps](https://github.com/nwjs/nw.js/wiki/How-to-package-and-distribute-your-apps) +* [How to use Node.js modules in node-webkit](https://github.com/nwjs/nw.js/wiki/Using-Node-modules) -And our [Wiki](https://github.com/rogerwang/node-webkit/wiki) for much more. +And our [Wiki](https://github.com/nwjs/nw.js/wiki) for much more. ## Community @@ -109,10 +104,10 @@ Issues are being tracked here on GitHub. ## License -`node-webkit`'s code in this repo uses the MIT license, see our `LICENSE` file. To redistribute the binary, see [How to package and distribute your apps](https://github.com/rogerwang/node-webkit/wiki/How-to-package-and-distribute-your-apps) +`node-webkit`'s code in this repo uses the MIT license, see our `LICENSE` file. To redistribute the binary, see [How to package and distribute your apps](https://github.com/nwjs/nw.js/wiki/How-to-package-and-distribute-your-apps) ## Sponsors The work is being sponsored by: -* [Intel](http://www.intel.com) +* [Intel](http://www.intel.com/content/www/us/en/homepage.html) * [Gnor Tech](http://gnor.net) diff --git a/docs/For Developers/Building NW.js.md b/docs/For Developers/Building NW.js.md new file mode 100644 index 0000000000..c56aa82c39 --- /dev/null +++ b/docs/For Developers/Building NW.js.md @@ -0,0 +1,115 @@ +# Building NW.js {: .doctitle} +--- + +[TOC] + +!!! important + This document is written for latest **NW 0.13**. For legacy build instructions, please read the [wiki page](https://github.com/nwjs/nw.js/wiki/Building-nw.js) on GitHub. + See our buildbot for official build configuration and steps: http://buildbot-master.nwjs.io:8010/waterfall + +## Prerequisites + +NW.js use same build tools and similar steps as Chromium. Read the instructions according to your platform to install `depot_tools` and other prerequistes: + +* [Windows](http://www.chromium.org/developers/how-tos/build-instructions-windows) +* [Mac OS X](https://chromium.googlesource.com/chromium/src/+/master/docs/mac_build_instructions.md) +* [Linux](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md) + +!!! note "Windows" + As suggested by Chromium document, you need to run `set DEPOT_TOOLS_WIN_TOOLCHAIN=0` or set the variable in your global environment. + CLang is the build tool used by non-Windows platforms. On Windows, it's not supported yet. You need to run `set GYP_DEFINES="clang=0"` to disable CLang on Windows before going to next steps. + +!!! note "Xcode 7" + Mac SDK 10.11 as part of Xcode 7 is not supported yet. If you have upgraded to Xcode 7, either downgrade to Xcode 6 or copy Mac SDK 10.10 from other machines under ```xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs`` as suggested by [Chromium document](https://chromium.googlesource.com/chromium/src/+/master/docs/mac_build_instructions.md). + +## Get the Code + +**Step 1.** Create a folder for holding NW.js source code, like `$HOME/nwjs`, and run following command in the folder to generate `.gclient` file: + +```bash +mkdir -p $HOME/nwjs +cd $HOME/nwjs +gclient config --name=src https://github.com/nwjs/chromium.src.git@origin/nw13 +``` + +Generally if you are not interested in running Chromium tests, you don't have to sync the test cases and reference builds, which saves you lot of time. Open the `.gclient` file you just created and replace `custom_deps` section with followings: + +```python +"custom_deps" : { + "src/third_party/WebKit/LayoutTests": None, + "src/chrome_frame/tools/test/reference_build/chrome": None, + "src/chrome_frame/tools/test/reference_build/chrome_win": None, + "src/chrome/tools/test/reference_build/chrome": None, + "src/chrome/tools/test/reference_build/chrome_linux": None, + "src/chrome/tools/test/reference_build/chrome_mac": None, + "src/chrome/tools/test/reference_build/chrome_win": None, +} +``` + +**Step 2.** Run following command in your terminal: +``` +gclient sync --with_branch_heads +``` + +This usually downloads 20G+ from GitHub and Google's Git repos. Make sure you have a good network provider and be patient :stuck_out_tongue: + +When finished, you will see a `src` folder created in the same folder as `.gclient`. + +!!! note "First Build on Linux" + If you are building on Linux **for the first time**, you need to run `gclient sync --with_branch_heads --nohooks` and then run `./build/install-build-deps.sh` to install dependencies on Ubuntu. See [Chromium document](http://dev.chromium.org/developers/how-tos/get-the-code) for detailed instructions of getting the source code. + +!!! note "First Build on Windows" + On Windows, you have to install [DirectX SDK](https://www.microsoft.com/en-us/download/details.aspx?id=6812) and copy the files into the source folder manually using following bash command: + +```bash +mkdir -p $HOME/nwjs/src/third_party/directxsdk/files +cp -r /c/Program\ Files\ \(x86\)/Microsoft\ DirectX\ SDK\ \(June\ 2010\)/* \ +$HOME/nwjs/src/third_party/directxsdk/files/ +``` + +## Build + +Build files are generated in `out/` folder during `gclient sync`. Run following command in your terminal will generate the Debug build of standard NW.js binaries in `out/Debug` folder: + +```bash +cd src +ninja -C out/Debug nwjs +``` + +!!! tip "Build Time" + Generally a full build takes hours of time depending on the performance of your machine. Recommended configuration is to build on a PC with multicore CPU (>=8 cores), SSD and large memory (>= 8G). And you can read [Build Faster](#build-faster) section below for some tips to speed up the build. + +To generate Release build, switch the second command to `ninja -C out/Release nwjs`. + +To build 32-bit/64-bit binaries or non-standard build flavors, you need to setup `GYP_DEFINES` variable in your environment and run `gclient runhooks --force` to generate build files. And then re-run the commands above to generate binaries. Continue to read following sections to find out how to setup `GYP_DEFINES`. + +### 32-bit/64-bit Build + +* Windows + - 32-bit: is the default build target + - 64-bit: `set GYP_DEFINES="target_arch=x64"` and rebuild in `out/Debug_x64` or `out/Release_x64` folder +* Linux + - 32-bit: **TODO: chroot** + - 64-bit: is the default build target +* Mac + - 32-bit: `export GYP_DEFINES="host_arch=ia32 target_arch=ia32"` and rebuild in `out/Debug` or `out/Release` folder + - 64-bit: is the default build target + +### Build Flavors + +* Standard: it's generated by default. Same as `GYP_DEFINES="nwjs_sdk=0 disable_nacl=1"`. +* SDK: `GYP_DEFINES="nwjs_sdk=1 disable_nacl=0"` +* NaCl: `GYP_DEFINES="disable_nacl=0"` + +See [Build Flavors](../For Users/Advanced/Build Flavors.md) for the differences of all supported build flavors. + +### Enable Proprietary Codecs + +Due to the license issue, the prebuilt binaries of NW.js doesn't support proprietary codecs, like H.264. So you can't play MP3/MP4 with `