electron-window-manager icon indicating copy to clipboard operation
electron-window-manager copied to clipboard

Uncaught Error: Could not call remote function 'createNew'

Open hevilp opened this issue 7 years ago • 5 comments

`

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 ....

hevilp avatar Jan 24 '18 18:01 hevilp

I saw now:

https://github.com/TamkeenLMS/electron-window-manager/issues/9

hevilp avatar Jan 24 '18 18:01 hevilp

@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().

a-sync avatar Jan 25 '18 10:01 a-sync

Yes I specified all arguments.

hevilp avatar Jan 25 '18 21:01 hevilp

Delete win2.onReady(); and it will work, I had the same problem

Cabeccar avatar Jun 16 '19 06:06 Cabeccar

How do you use onReady() properly.. I had same problem and deleted it but will need to use it as some point.

MarcKarasek avatar Nov 22 '19 20:11 MarcKarasek