Right today (August 19), the Intel open-technology technology center
released another version of the
node-webkit engine. This engine, as before, is interesting because it can open browser-like windows (based on the Chromium code) and use
Node.js API in them - so that it provides easy creation of
GUI applications using web
development methods (in JavaScript, HTML, CSS, WebGL
, etc.) for Windows, Mac OS X, and Linux.
The new version received the
number 0.7.1 and contains the Node engine of
version 0.10.12 , as it is easy to see in the test window:
![[window screenshot]](https://habrastorage.org/storage2/844/e13/fd3/844e13fd3e5ed52e081a6c3a992f1c1e.png)
')
I opened the test window code today
on Github , so that those who wish can familiarize themselves with it and see for themselves that the initial
(helloworld) programming steps
for node-webkit are just as simple as regular web development enhanced by the capabilities of
the Node API .
Less than a month ago (July 24),
I reviewed one of the previous versions of
node-webkit (version 0.6.3). Not much time has passed since then, however, a number of interesting innovations have appeared
in node-webkit :
- Added support for the app protocol . Now, in the application manifest, you can write the main parameter in the form of " " main ": " app: // hostname / path " ”, and any identifier can act as the host name ( hostname ), and the path ( path ) is counted from that root directory which is the manifest itself ( package.json file). After that, in the browser part of the application (in HTML, in CSS , etc.) all “absolute addresses from the root” (starting with a slash) will be counted from the same directory - this effect will be extremely useful for those who repack under the node- webkit any such application that previously spun on the Web and contained a lot of ways "from the root." It is clear that this is a special case. If the case is the opposite (all paths were relative), then you can not get back with the new protocol, but in the sense of "main" you can record, as before, the relative path from the manifest. (In the simplest case - "index.html" .)
- Now it is possible by javascript to change the value of an input element that has an attribute type = "file" ; thus, full automation of file uploads to the Network is provided in an intra-browser way (which is more convenient than in the API Node).
- In the new field App.manifest you can read the values ​​of the application manifest. You do not need to do require ('package.json') , because all this information is already read by node-webkit when the application is started.
- The entire command line now arrives at the App.open event handler. Previously, each command line parameter caused a separate such event, but now it is possible to handle those cases where the command line not only lists the files that need to be opened, but also indicates parameters that have some other value (for example, settings flags).
- API getUserMedia can be used to capture a copy of the entire screen (as in the example, for Chrome intended).
The new version also eliminates bugs, in some cases, before leading to the application crash or hang.