In the main window I write the following code and it works:
nw.Window.get(null).evalNWBinModule(null, "./my.bin", "./my.js");
import("./my.js");
but if I create a new window via nw.Window.open(MyOtherURL);
where I then move this code, then after running I get an error:
Uncaught (in promise) TypeError: Failed to resolve module specifier './my.js'
what is the launch difference and what else do i need to configure?
nw.Window.get()
returns a reference to the Window itself, so you can then chain off of it.nw.Window.open()
, does not, but it does have a callback function gives you access to the new window, which you can chain off of.However I'm not sure that will do what you want. You will likely be better off having the code run in your
page2.html
file directly.