node-webkit v0.4.2 released

5 views
Skip to first unread message

Roger Wang

unread,
Feb 20, 2013, 9:47:53 PM2/20/13
to node-...@googlegroups.com
I'm happy to release v0.4.2. Here are the binaries:

https://s3.amazonaws.com/node-webkit/v0.4.2/node-webkit-v0.4.2-win-ia32.zip
https://s3.amazonaws.com/node-webkit/v0.4.2/node-webkit-v0.4.2-osx-ia32.zip
https://s3.amazonaws.com/node-webkit/v0.4.2/node-webkit-v0.4.2-linux-x64.tar.gz
https://s3.amazonaws.com/node-webkit/v0.4.2/node-webkit-v0.4.2-linux-ia32.tar.gz

There is a new tool 'nwsnapshot' in the zip file. It's for the new feature of protecting JS source code. You can just remove it if you don't need this feature.

New features
==========
* Strong JS source code protection (experimental):  The JavaScript source code of your application can be protected by compiling to native code. Only the native code is distributed with the application and is loaded when the application starts.  This feature is still experimental -- API & tool usage are subject to change in future versions. See the document for usage, limitations and sample: https://github.com/rogerwang/node-webkit/wiki/Protect-JavaScript-source-code-with-v8-snapshot

* API for capturing the page: Window.capturePage(callback [, image_format]): captures the visible area of the window. See doc: https://github.com/rogerwang/node-webkit/wiki/Window and a simple demo usage can be found here: https://gist.github.com/zhchbin/4749217

* Alternate (active) tray icon for Mac: see Tray.alticon in https://github.com/rogerwang/node-webkit/wiki/Tray

Bug fixes
=======
- enabled and checked MenuItem properties don't work on Windows (#239)

- menuitem checkbox type doesn't work (#391)

- process.exit not fired (#408)

- Autocomplete suggestions aren't shown if input element has ID or name attribute (#434)

abeq

unread,
Feb 20, 2013, 10:24:52 PM2/20/13
to node-...@googlegroups.com
Hi, Roger

> * Strong JS source code protection (experimental): 

I wrote foo.js with following code:
function foo(){
var fs = require('fs');
...
}
foo();
And exec "nwsnapshot --extra_code foo.js foo.bin".
But it said "Uncaught ReferenceError: require is not defined at ...

Does nwsnapshot not know node functions?

Regards,

abeq

Roger WANG

unread,
Feb 20, 2013, 11:22:46 PM2/20/13
to abeq, node-...@googlegroups.com
It doesn't know Node nor DOM. You should remove the last line, just keep
the function definition there and call it from other places of your app.

--
Roger WANG Intel Open Source Technology Center

Roger WANG

unread,
Feb 20, 2013, 11:23:56 PM2/20/13
to abeq, node-...@googlegroups.com
"And the scripts runs/loads loads very early (you can assume it's
earlier than context creation) so DOM objects such as window is not
defined. So you may want to defined functions and pass window as
argument."

https://github.com/rogerwang/node-webkit/wiki/Protect-JavaScript-source-code-with-v8-snapshot

Boris Dudelsack

unread,
Feb 21, 2013, 7:51:46 AM2/21/13
to node-...@googlegroups.com, abeq
Some changes in v0.4.2 made "loaded" event of gui.Window not to be fired in some cases (maybe cache?). v0.4.1 works fine in every case.

Roger WANG

unread,
Feb 21, 2013, 9:29:06 AM2/21/13
to Boris Dudelsack, node-...@googlegroups.com, abeq
Boris Dudelsack <bdude...@gmail.com> writes:

> Some changes in v0.4.2 made "loaded" event of gui.Window not to be fired in
> some cases (maybe cache?). v0.4.1 works fine in every case.

Could you please provide the code?

Thanks

Boris Dudelsack

unread,
Feb 21, 2013, 11:25:26 AM2/21/13
to node-...@googlegroups.com, Boris Dudelsack, abeq
I'm afraid i still haven't found a way to constantly reproduce it, but the code looks like:

var gui = require('nw.gui');
var wnd = gui.Window.open("http://www.google.com")
wnd.on("loaded",function() {
console.log("Loaded");
});

Maybe it's the context of the event handler what makes sense.

Boris Dudelsack

unread,
Feb 21, 2013, 11:38:07 AM2/21/13
to node-...@googlegroups.com, Boris Dudelsack, abeq
I've found the cause. "showDevTools" function somehow influences ist. 

var gui = require('nw.gui');

gui.Window.get().showDevTools();

var wnd = gui.Window.open("http://www.google.de")
wnd.on("loaded",function(){
alert("Loaded");
});

If you run the app with this code sometimes no alert is shown. You can put the window openning code into a function
and launch on a button click it has the same result.

cl...@ratiosoftware.com

unread,
Feb 21, 2013, 6:33:47 PM2/21/13
to node-...@googlegroups.com
Roger, this is amazing stuff. Node-webkit just keeps getting better, thank you for the awesome project!

chensh...@gmail.com

unread,
Feb 22, 2013, 1:21:44 AM2/22/13
to node-...@googlegroups.com
when the feature about autoupdate is support?

Roger WANG

unread,
Feb 22, 2013, 3:34:49 AM2/22/13
to Boris Dudelsack, node-...@googlegroups.com, abeq
Boris Dudelsack <bdude...@gmail.com> writes:

> I've found the cause. "showDevTools" function somehow influences ist.
>
> var gui = require('nw.gui');
>
> gui.Window.get().showDevTools();
>
> var wnd = gui.Window.open("http://www.google.de")
> wnd.on("loaded",function(){
> alert("Loaded");
> });
>
> If you run the app with this code sometimes no alert is shown. You can put
> the window openning code into a function
> and launch on a button click it has the same result.

Thanks for reporting. I can confirm it and filed a new issue for it:
https://github.com/rogerwang/node-webkit/issues/469

it will be fixed in the next release.

Roger WANG

unread,
Feb 22, 2013, 3:35:59 AM2/22/13
to chensh...@gmail.com, node-...@googlegroups.com
<chensh...@gmail.com> writes:

> when the feature about autoupdate is support?

There is no scheduled date for this feature. You can watch this issue
for updates. We do the planning with the 'milestone' tag.

https://github.com/rogerwang/node-webkit/issues/233

Thanks
Reply all
Reply to author
Forward
0 new messages