What's New in 0.13

802 views
Skip to first unread message

Roger Wang

unread,
Mar 23, 2016, 4:29:01 AM3/23/16
to nw.js

http://nwjs.io/blog/whats-new-in-0.13/


Overview


NW.js v0.13 brings most features in the Chromium browser, including Chrome Apps support, chrome.* platform APIs, NaCl and Pepper plugin, builtin PDF viewer, printing preview, rich notifications and many more. This is done by following upstream closely with an adjusted architecture. We also expect faster release cycle and better stability with the new architecture in 2016.

This post introduces the following topics for the new release:

  • chrome.* API support
  • Chrome (Packaged) App support
  • More Features from Chromium Browser
  • Better Native Node.js Module Support
  • Full DevTools Extension Support and Embed Devtools as Part of Your App
  • Content Verification
  • Official Documentation
  • Multiple Build Flavors
  • Mixed Context Mode
  • Under the hood
  • Changes and migration
  • Acknowledgements

chrome.* API support


In previous 0.12 version we started to support chrome.webRequest API to let you intercept network requests made by DOM. In this version we bring even more of chrome.* API. Including rich notification, context menu, usb, etc.

With rich notifications you can put buttons, lists, images, icon and progress bar in the notification.

notification notification
Rich notifications


See the upstream docs for the listing of chrome APIs: we support all chrome.* API in the Chrome App platform. In addition, we support some chrome.* API in the Extension Platform. There is document tracks the list of them.


NW developers follows upstream changes closely and bring them to the application developers. Previously in 0.12 we used the new code cache feature in the V8 engine to improve JS source code compilaton


Chrome (Packaged) App support


After supporting many chrome.* APIs, the manifest spec for Chrome Apps are also supported in straightforward way. That means many Chrome Apps can be run directly on NW. Clone the sample apps repository and run one of them with:


$ /path/to/nw.exe <folder path of the manifest.json file>

or drag the folder to the NW executable. CRX packaging for Chrome Apps is not supported but you can use the packaging mechanisms provided by NW. See package document for more. Also see thousands of Chrome Apps online.


And of course Node.js APIs can be accessed from Chrome App: add “node” permission to manifest.json and you are ready to call nw.require().


So NW supports 2 kinds of applications now: Chrome Apps and NW Apps. The one with a ‘manifest.json’ file is a Chrome App (with an exception below), while NW App is the one with ‘package.json’. They run in different security model: Chrome Apps run in the same model from Chromium upstream; NW App runs in the native “Node” security model provided by NW platfrom. Apps that has “node” permission in ‘manifest.json’ is a NW App.


The native security model tries to provide you the maximum capability as in a traditional C++ desktop application. You can access all the chrome.* APIs without declaring permission in manifest, load all Node.js libraries and DOM operations are not limited by cross origin checks and CSP any more. Untrusted contents are still running in the same security model from Chromium browser. For more information, see Security in NW.js.


More Features from Chromium Browser


NW.js application develpers have been asking for more browser features and compatibility between NW.js and Chromium upstream. With the new browser component based architecuture (see "under the hood" section below), we are now able to provide many features in the Chromium browser, including print preview, PDF viewer and SSL client certificates. Below are some samples:

pdf
The built-in PDF viewer

print
Print Preview

clipper
Clipper made by Adam Lynch with the Transparency feature in NW


Better Native Node.js Module Support

Native modules built for Node.js can be loaded into NW.js now. The previous tool to build them for NW.js -- 'nw-gyp' is not needed any more. In Linux and OSX you can just load the native module built for Node.js directly. In windows you'll need to replace a file installed by Node. See more information in the announcement.


Full DevTools Extension Support and Embed Devtools as Part of Your App


NW.js is now able to fully support devtools extensions, including the one for ReactJS etc. To use them, see the guide here.

react devtools
Debugging React App easily with React Devtools Extension


A method is added to webview tag, so you can launch devtools for this webview. Besides opening a new devtools window, You can also place the devtools UI in a webview. This enables IDE software for better UI. See the doc for more information.

embedding devtools
A sample IDE for debugging mobile web page on the desktop


Content Verification


The new feature 'content verification', or 'app signing', prevents loading unsigned files with your official binary. Given a keypair, you sign the application files and redistribute the signature file with your application. The public key is built into your NW.js binary. If users or 3rd party modified the files. NW will report the file is corrupted and quit immediately.

See the official document for this feature for more information.


Official Documentation


Starting from this version, the official documentation is maintained in the same repo we use for development, and is available inhttp://docs.nwjs.io . Welcome to submit PR for it. Documents for the previous versions will be in the wiki as usual.


Multiple Build Flavors


There are 3 builds for each platform - normal build, sdk build and Nacl build. Normal build doesn't have devtools, only SDK build does. lt can be opened by pressing F12 (Cmd-Alt-I on OSX). SDK packages also have more development tools to be exposed in the following releases, as well as the NaCl support.

Our build infrastructure enables live binary build from git tip so you can access to the latest binary from http://dl.nwjs.io/live-build/


Mixed Context Mode

In this mode, Node.js objects and DOM objects reside in the same Context (thus will be destroyed upon navigation). The trade-off is that mixed mode is easier to use in some cases, while the normal mode provides better isolation and supports navigation or multi-page application better. For more information, see the discussion in #3107.


Under the hood


Under the hood for this improvement is the effort made by upstream to move the extension mechanism towards the Content layer, as well as componentizing the browser modules. NW will evolve with upstream towards the “app shell” architecture. In future we’ll split the browser components as separate loadable modules so the binary size can be shrunk significantly.

arch
NW13 architecture


We are also using it to refactor the implementation of ‘nw.gui’ library in 0.12. The extension mechanism provide a lightweight and elegant solution for JS API binding. With it we are able to eliminate the overhead of additional IPC messages used in previous version.


Changes and migration


We also changed the API to put everything from the ‘nw.gui’ library into the ‘nw’ object. To provide API compatibility with 0.12 applications, we evaluate a builtin shim script at window context creation. It simulates the API provided by 'require('nw.gui')'.

Refer to the migration guide if you have 0.12 application. We have been working to make the changes minimal under the new architecture.

Zoran Krnetic

unread,
Mar 23, 2016, 5:31:12 AM3/23/16
to nw.js

Thank you very much Roger for making this excellent tool! I'm looking forward releasing new SeeYouLink app based on nwjs 0.13.0.

Zoran

iammayt...@gmail.com

unread,
Mar 27, 2016, 10:27:22 AM3/27/16
to nw.js
add mp3 codec please.

lza...@gmail.com

unread,
Mar 27, 2016, 3:20:24 PM3/27/16
to Roger Wang, nw.js
Congrats for this release!! 
I am excited to build it and get my hands dirty :))

Laszlo
--
You received this message because you are subscribed to the Google Groups "nw.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

kailn...@gmail.com

unread,
Apr 1, 2016, 4:26:22 AM4/1/16
to nw.js
Looks promising!
Any chance for silent print in the future?

Roger

unread,
Apr 1, 2016, 5:18:56 AM4/1/16
to kailn...@gmail.com, nw.js
Does the command line switch '--kiosk-printing' work for you?

On Fri, Apr 1, 2016 at 4:26 PM <kailn...@gmail.com> wrote:
Looks promising!
Any chance for silent print in the future?

--

kailn...@gmail.com

unread,
Apr 1, 2016, 5:27:59 AM4/1/16
to nw.js, kailn...@gmail.com
Is it supposed to work? never tried it in nw.js but in chrome and chrome app it does not work.
This is the main reason i consider migrate from chrome app to nw.js cuz of lack of easy print of documents created in large numbers like invoices from Pos terminals.
The nw.js node.js module support looks promising to create pdf then print it without print preview. But a regular DOM element print() without preview would be awesome.

Roger

unread,
Apr 1, 2016, 5:34:06 AM4/1/16
to kailn...@gmail.com, nw.js
I tried it here and it's working, but I'm not sure whether it fulfill your needs.

Roger

unread,
Apr 1, 2016, 5:35:33 AM4/1/16
to kailn...@gmail.com, nw.js
btw, we have an issue tracking this, please discuss this feature there:

kailn...@gmail.com

unread,
Apr 1, 2016, 5:52:52 AM4/1/16
to nw.js, kailn...@gmail.com
I tied it out and it works now both with chrome and chrome app. I guess it will work with nw.js too.
I will create a request in the discuss you mentioned.
Thanks the help!

zeta...@gmail.com

unread,
Aug 23, 2016, 9:27:44 AM8/23/16
to nw.js
I hope I'm at the right place and that my question is not too stupid ...

The documentation (1) says nw is running as a chrome app internally. But Google kinda said they plan to deprecate the chrome apps (2) Does this mean it will require much more work keeping up with Chromium releases in the future ? And will this mean there will soon (1-2 years) be another major version of nw.js with a complete new API!?

I'm currently running nw 0.12 and thinking about migrating to nw 0.13 witch will require a lot of work for me because the breaking changes. Would it be better for me to wait until next major release of nw.js instead !?



Ervin Kosch

unread,
Aug 23, 2016, 5:52:38 PM8/23/16
to nw.js
In the thread below this was discussed.  NW.JS is planning on continued support for Chrome Apps.  The only way I see this not working is if Google completely ripped out all the code.

BTW: Why do we have thread about a version of NW.JS that is 4 versions behind the current beta version?

Roger

unread,
Aug 23, 2016, 9:15:06 PM8/23/16
to zeta...@gmail.com, nw.js
Google is still supporting it in ChromeOS. So the base architecture is still here. More importantly, the base code is used for Chrome Extensions as well, which is still an important part of the Chrome browser.

Roger

--

Roger

unread,
Aug 23, 2016, 9:16:13 PM8/23/16
to Ervin Kosch, nw.js
I think it should be "What's new in 0.13 and later version", which is for developers looking into migration to this version.

Roger

--
Reply all
Reply to author
Forward
0 new messages