Fix Google login

This commit is contained in:
TC
2019-09-11 23:46:19 +02:00
parent 474bfd19a2
commit 746b5f13bb

View File

@ -42,8 +42,10 @@ function createMainWindow() {
backgroundColor: "#000", backgroundColor: "#000",
show : false, show : false,
webPreferences : { webPreferences : {
nodeIntegration: false, nodeIntegration : false,
preload : path.join(__dirname, "preload.js") preload : path.join(__dirname, "preload.js"),
nativeWindowOpen: true, // window.open return Window object(like in regular browsers), not BrowserWindowProxy
affinity : "main-window" // main window, and addition windows should work in one process
}, },
frame : !is.macOS(), frame : !is.macOS(),
titleBarStyle: is.macOS() ? "hiddenInset": "default" titleBarStyle: is.macOS() ? "hiddenInset": "default"
@ -86,6 +88,17 @@ function createMainWindow() {
} }
}); });
win.webContents.on(
"new-window",
(e, url, frameName, disposition, options) => {
// hook on new opened window
// at now new window in mainWindow renderer process.
// Also, this will automatically get an option `nodeIntegration=false`(not override to true, like in iframe's) - like in regular browsers
options.webPreferences.affinity = "main-window";
}
);
win.on("move", () => { win.on("move", () => {
let position = win.getPosition(); let position = win.getPosition();
store.set("window-position", { x: position[0], y: position[1] }); store.set("window-position", { x: position[0], y: position[1] });