Node-webkit version 0.4.1 innovations
The new version has the
![[screenshot]](https://habrastorage.org/storage2/ba3/f71/2a7/ba3f712a75a501b27ad40cbb773e9541.png)
Almost seven weeks have passed since the day (December 18), when I reviewed one of the previous versions
First of all, it is necessary to mention the release plan for
I
Here is the list of other innovations of
- An application running on the
node-webkit engine can now set any value for the“ User-Agent ” headerin the HTTP request to remote sites. For this purpose, it is enough to change the value of the" user-agent " field in the application manifest . Inside this value, you can use some keywords that will automatically be replaced by the version or name of the application, the version ofnode-webkit or WebKit, information about the operating system and processor capacity (similar to those available in popular browsers). If the value of the" User-Agent " header is not changed, then it indicates the version of Chromium on whichnode-webkit is built.
- The means of remote control of the computer have been seriously expanded: trusted remote pages opened
in node-webkit provide access to the Node engine in accordance with a certain white list. This list of trusted sites is indicated in the application manifest as the value of the field with the name" node-remote " that I invented. The list is compiled completely according to the same rules as the list of local sites (which you can access the browser directlywithout a proxy) - in other words, it contains a comma-separated list (or a semicolon) of a number of patterns, which can be site names (for example, “example.com”, “* example.com”, “* .example.com”, “* example. com: 99 "," https: //x.*.example.com: 99 "), or domain suffixes (" .example.com "," .com "," http: //.example.com "),or IP addresses (“127.0.1”, “[0: 0 :: 1]”, “[:: 1]”, “http: // [:: 1]: 99”),or IP ranges ( “192.168.1.1/16”, “fefe: 13 :: abc / 33”), or simply the keyword “"(Corresponding to the list" 127.0.0.1, :: 1, localhost "). Now you can keep some of the source code of the application on your site (both scripts and interfaces), and it will work on the computer on the user through the Node API. One possible solution to the software update problem.
- An HTTP authentication dialog has appeared in case a remote site asks for a name and password.
- The document.cookie API for local pages is supported .
- The
" chromium-args " field (for simulating Chromium command line arguments: for example,"--enable-webaudio-input" for experimenting with the getUserMedia API) and the" js-flags " field (for setting V8 parameters: for example, appeared in the application manifest"--harmony_proxies --harmony_collections" to access part of the Harmony JavaScript features).
- The API “ require (" nw.gui ". Window.open () " has been replenished with a new field
"new-instance" , through which you can start a new instance of the Node process and WebKit in a new window.
- The same Window object has a zoom property (and an event of the same name), reflecting the intra-browser increase in the site. In some cases, this is easier than changing the
font-size for the body .
- You can follow hyperlinks with non-browser protocol names (for example,
“ mailto: ” or “ area: // ”), and they will be fed to handlers registered in the operating system.
- The process.mainModule property will begin to point to the main script registered in the
"node-main" field in the application manifest .
As you can see, almost a dozen useful innovations have been accumulated - and each of them will please