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.top = '0';
iframe.style.left = '0'; iframe.style.left = '0';
iframe.style.border = 'none'; iframe.style.border = 'none';
window.gameWindow.onbeforeunload = () => window.gameWindow?.close();
window.gameWindow.document.body.append(iframe); window.gameWindow.document.body.append(iframe);
window.gameWindow.onload = () => { if (iframe.contentWindow) {
if (window.gameWindow) { window.gameWindow.onload = () => {
window.gameWindow.console.debug = (msg: string) => if (iframe.contentWindow) {
consoleLog('debug', msg); iframe.contentWindow.console.debug = (msg: string) =>
window.gameWindow.console.log = (msg: string) => consoleLog('debug', msg);
consoleLog('log', msg); iframe.contentWindow.console.log = (msg: string) =>
window.gameWindow.console.info = (msg: string) => consoleLog('log', msg);
consoleLog('info', msg); iframe.contentWindow.console.info = (msg: string) =>
window.gameWindow.console.warn = (msg: string) => consoleLog('info', msg);
consoleLog('warn', msg); iframe.contentWindow.console.warn = (msg: string) =>
window.gameWindow.console.error = (msg: string) => consoleLog('warn', msg);
consoleLog('error', 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 { } else {
window.gameWindow.focus(); window.gameWindow.focus();