nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

error 'global is not defined' after navigating to a remote page

Open cchersin opened this issue 9 years ago • 3 comments

NWJS Version : 0.26.5 Operating system: windows 8

package.json { "name": "test", "main": "index.html", "node-remote": "<all_urls>" }

index.html <html> <body> test </body> <html>

To reproduce:

1 - Open dev tools console 2 - type: location.href="http://www.google.com" 3 - type: location.href=chrome.runtime.getURL("index.html") 4 - type: global ---> error: Uncaught ReferenceError: global is not defined

cchersin avatar Nov 10 '17 12:11 cchersin

I can reproduce this issue on Linux/Windows with nwjs-sdk-v0.26.5.

Christywl avatar Nov 13 '17 01:11 Christywl

Same issue in nw 0.27.5

cchersin avatar Jan 15 '18 07:01 cchersin

I hit this issue when using remote URLs vs. filepath; try adding this to package.json:

"node-remote" : "<all_urls>",

(see documentation here: http://docs.nwjs.io/en/latest/References/Manifest%20Format/) might be similar issue to what this guy faced, hence where I found this solution: https://github.com/nwjs/nw.js/issues/4937

(i was using nwjs-sdk-v0.29.3-osx-x64 on Mac)

JolieOlsen avatar Sep 18 '18 23:09 JolieOlsen