electron-window-manager
electron-window-manager copied to clipboard
Uncaught Error: Could not call remote function 'createNew'
`
var win1pfad = path.join(__dirname, "win1.html"); var windowManager = remote.require('electron-window-manager');
function create_win1() { // Create a new window var win2 = windowManager.createNew('win1', 'Windows 1'); win2.loadURL(win1pfad); win2.onReady(); win2.open(); } document.getElementById("btnwin1").onclick = create_win1; `
Uncaught Error: Could not call remote function 'createNew'. Check that the function signature is correct. Underlying error: Cannot read property 'focus' of null Error: Could not call remote function 'createNew'. Check that the function signature is correct. Underlying error: Cannot read property 'focus' of null at callFunction ....
I saw now:
https://github.com/TamkeenLMS/electron-window-manager/issues/9
@hevilp Just to be clear: did you also had to specify all the arguments to make this work?
var win2 = windowManager.createNew('win1', 'Windows 1', null, false, {}, false);
Like so?
Also: you should use .setURL() instead of .loadURL() before using .open().
Yes I specified all arguments.
Delete win2.onReady(); and it will work, I had the same problem
How do you use onReady() properly.. I had same problem and deleted it but will need to use it as some point.