nw.js: nw.Window.open callback returns undefined object when using new_instance

In nwjs 0.13-beta6, win64 SDK build, when opening a new window with “new_instance” set to true, the Window.open callback returns an undefined object. Even the ‘this’ object is undefined.

nw.Window.open('new.html', {
   'new_instance': true
},function(win){
   // win is undefined here
});

Edit: Unless this is by design because the new window will have a new context that we are not supposed to access?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 54 (17 by maintainers)

Most upvoted comments

Thank you Roger for this project. You are enabling many people to create the future!

0.35.4 was just released with a testing version of #5875. This issue is fixed under it. Please see more information in that issue. Thanks.

still a bug in 0.18.5 … hope it will be fixed soon, we really need it

The depending issue #5875 is under active development and will be released soon. We’ll need testers for that issue. Once it’s resolved this one will be fixed easily. Thanks.

Almost two years later, this defect is still without resolution??

This issue is still a major roadblock for us 🚧 🚧

We cannot load remote pages in popup Windows using nw.Window.open unless we grant them full local Node rights (ie. make them Node Frames by including their urls in the node-remotemanifest entry).

Because unless they are Node Frames the nwWindow argument in the callback to nw.Window.open will be undefined.

But that’s a major security concern: Granting full local execution rights to remote source code. Since we don’t want to do that we have to remain on nwjs 0.16.1 😢

reassign to @ghostoy since we found another way to support this.

@gpetrov I’m afraid I can’t promise a deadline but I’ll work on this issue at the highest priority.

I am working on an OS based on node, i.e using nw js for Apps. Right now I have it running Apps as child processes due to this very bug. And as a result things like the browser (which uses webview) freezes the whole thing at times because they are running off the same process. Essentially I have to halt third party Apps from being used until this problem is resolved.