Skip to content
This repository has been archived by the owner on Aug 7, 2022. It is now read-only.

Commit

Permalink
タイトルが変わる問題を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiro527 committed Apr 4, 2021
1 parent fba2238 commit 0251cff
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ const initGameWindow = () => {
width: 1200,
height: 800,
show: false,
title: "LaF",
fullscreen: config.get("Fullscreen", false),
webPreferences: {
preload: path.join(__dirname, "js/preload.js"),
contextIsolation: false,
enableRemoteModule: true
contextIsolation: false
}
});
gameWindow.removeMenu();
Expand All @@ -168,7 +168,6 @@ const initGameWindow = () => {
gameWindow.once("ready-to-show", () => {
splashWindow.destroy();
if (config.get("isMaximized", true)) gameWindow.maximize();
gameWindow.setTitle("LaF");
gameWindow.show();
});

Expand Down Expand Up @@ -207,6 +206,10 @@ const initGameWindow = () => {
};
});

gameWindow.on('page-title-updated', (e) => {
e.preventDefault();
});

gameWindow.webContents.on("did-finish-load", () => {
gameWindow.webContents.send("DID-FINISH-LOAD");
console.log("DID-FINISH-LOAD");
Expand All @@ -219,6 +222,7 @@ const initNewWindow = (url, title) => {
height: 900,
show: false,
parent: gameWindow,
title: `LaF: ${title}`,
webPreferences: {
nodeIntegration: true,
contextIsolation: false
Expand All @@ -231,7 +235,6 @@ const initNewWindow = (url, title) => {
win.loadURL(url);

win.once("ready-to-show", () => {
win.setTitle(`LaF: ${title}`);
win.show();
});

Expand Down Expand Up @@ -269,6 +272,11 @@ const initNewWindow = (url, title) => {
shell.openExternal(url);
};
});

win.on('page-title-updated', (e) => {
e.preventDefault();
});

win.webContents.on("will-prevent-unload", (event) => {
if (!dialog.showMessageBoxSync({
buttons: [langPack.leavePage, langPack.cancel],
Expand Down

0 comments on commit 0251cff

Please sign in to comment.