Can't open new browserwindow in build version


#1

Hello,

I’m building an electron application that works like this:
The main browserwindow has node integration set to false and has a preload script that gives access to a couple of things. One of those things is the ability to spawn a new browser window with the same configuration, like:

//part of preload.js
...
GlobalVariable = {
...
  open: url => {
		//window.open(url)
		const win = new BrowserWindow({
			title:'Foo',
			webPreferences:{
				nodeIntegration: false,
				preload: path.join(__dirname, 'preload.js')
			},
		});
		win.focus();

		var webContents = win.webContents;
		webContents.on('did-fail-load',console.log);

		if(url[url.length-1] !== '/') url += '/'
		win.loadURL(url);
	}
...
}
...

This works perfect while developing (running via node-electron). But when build (using electron-packager) it fails to open new browser windows.

Since I’m pretty new to Electron I wanted to check here if there’s something I need to know about this before reporting a bug…

Is there a way to still have the debug tools in a build version?