1
0
mirror of https://github.com/zumbiepig/MineXLauncher.git synced 2025-06-08 09:24:48 +00:00
This commit is contained in:
zumbiepig 2024-09-10 18:28:10 -07:00
parent f908f4bc72
commit a48a3f2eed
No known key found for this signature in database
GPG Key ID: 17C891BE28B953DE

View File

@ -125,25 +125,27 @@ const game = {
iframe.style.top = '0';
iframe.style.left = '0';
iframe.style.border = 'none';
window.gameWindow.onbeforeunload = () => window.gameWindow?.close();
window.gameWindow.document.body.append(iframe);
window.gameWindow.onload = () => {
if (window.gameWindow) {
window.gameWindow.console.debug = (msg: string) =>
consoleLog('debug', msg);
window.gameWindow.console.log = (msg: string) =>
consoleLog('log', msg);
window.gameWindow.console.info = (msg: string) =>
consoleLog('info', msg);
window.gameWindow.console.warn = (msg: string) =>
consoleLog('warn', msg);
window.gameWindow.console.error = (msg: string) =>
consoleLog('error', msg);
}
};
if (iframe.contentWindow) {
window.gameWindow.onload = () => {
if (iframe.contentWindow) {
iframe.contentWindow.console.debug = (msg: string) =>
consoleLog('debug', msg);
iframe.contentWindow.console.log = (msg: string) =>
consoleLog('log', msg);
iframe.contentWindow.console.info = (msg: string) =>
consoleLog('info', msg);
iframe.contentWindow.console.warn = (msg: string) =>
consoleLog('warn', msg);
iframe.contentWindow.console.error = (msg: string) =>
consoleLog('error', msg);
}
};
window.gameWindow.onbeforeunload = () => game.stop();
window.gameWindow.onbeforeunload = () => game.stop();
iframe.contentWindow.onbeforeunload = () => game.stop();
}
}
} else {
window.gameWindow.focus();