Node-webkit 0.7.1 innovations

    Just today (August 19) Intel's Technology Center open source gave on-gorá the next version of the engine node-webkit . This engine, as before, is interesting in that it can open browser-like windows (based on Chromium code) and use the 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 operating systems.

    The new version received the number 0.7.1 and contains the Node engine version 0.10.12 , as you can easily see in the test window:

    [window screenshot]

    I opened the code for the test window on Github today , so those who wish can familiarize themselves with it and see for themselves that the initial (helloworld) programming steps for node-webkit are no more complicated than 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 not uninteresting innovations appeared in node-webkit :

    • Support for the app protocol has appeared . 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 , in which the manifest itself lies (file package.json ). 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 begin to be counted from the same directory - this effect will be extremely useful for those who are repackaging under a node-webkit some such application that previously spun on the Web and contained a lot of paths “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 mess with the new protocol, but in the value of "main" write, as before, the relative path from the manifest. (In the simplest case,  "index.html" .)
       
    • Now you can use a javascript to change the value of an input element that has the type = "file" attribute ; in this way, full automation of file uploads to the network is ensured by the intra-browser method (which is more convenient than in the Node API).
       
    • In the new App.manifest field, you can read the application manifest values. You do not need to do require ('package.json') once again , because all this information is already read by node-webkit when the application starts.
       
    • The App.open event handler now receives the entire command line. Previously, each command line parameter triggered a separate such event, but now you can handle those cases when 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).
       
    • The getUserMedia API can now be used to capture a copy of the entire screen (as in the example for Chrome intended).

    The new version also fixes bugs that in some cases previously led to the crash or freeze of the application.

    Also popular now: