New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: nw is not defined after changing windows location #4937

Closed
angufix opened this Issue Jun 3, 2016 · 2 comments

Comments

Projects
None yet
4 participants
@angufix

angufix commented Jun 3, 2016

Verions tested 0.13.4 sdk x64 and 0.14 sdk x 64
OS: Win7

Getting the "ReferenceError: nw is not defined" after changing windows location. The strange thing is that in main.html the win variable is properly initialized with the nw.Window.
untitled

main.html:

<!DOCTYPE html>
<html>
    <head>
        <script>
                win.window.location.assign('http://github.com');
        </script>
    </head>
    <body>        
    </body>
</html>

package.json:

{
  "name": "h2",
  "version": "0.0.1",
  "private": true,
  "main": "main.html",
  "window": {
    "show": true
  },
  "inject_js_start":"./lib/winsave.js"
}

./lib/winsave.js

var win       = nw.Window.get();
console.log('test');

the winsave.js script stops working

@RohitSharma27

This comment has been minimized.

RohitSharma27 commented Jun 4, 2016

@angufix Add "node-remote" : "<all_urls>" in your package.json. Check this out for possible node-remote values.

@hiwanz

This comment has been minimized.

hiwanz commented Oct 27, 2016

@RohitSharma27 thx,it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment