mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
Fix Google login
This commit is contained in:
17
index.js
17
index.js
@ -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] });
|
||||||
|
|||||||
Reference in New Issue
Block a user