mirror of
https://github.com/zumbiepig/MineXLauncher.git
synced 2025-06-08 09:24:48 +00:00
.
This commit is contained in:
parent
f908f4bc72
commit
a48a3f2eed
@ -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);
|
||||||
|
|
||||||
|
if (iframe.contentWindow) {
|
||||||
window.gameWindow.onload = () => {
|
window.gameWindow.onload = () => {
|
||||||
if (window.gameWindow) {
|
if (iframe.contentWindow) {
|
||||||
window.gameWindow.console.debug = (msg: string) =>
|
iframe.contentWindow.console.debug = (msg: string) =>
|
||||||
consoleLog('debug', msg);
|
consoleLog('debug', msg);
|
||||||
window.gameWindow.console.log = (msg: string) =>
|
iframe.contentWindow.console.log = (msg: string) =>
|
||||||
consoleLog('log', msg);
|
consoleLog('log', msg);
|
||||||
window.gameWindow.console.info = (msg: string) =>
|
iframe.contentWindow.console.info = (msg: string) =>
|
||||||
consoleLog('info', msg);
|
consoleLog('info', msg);
|
||||||
window.gameWindow.console.warn = (msg: string) =>
|
iframe.contentWindow.console.warn = (msg: string) =>
|
||||||
consoleLog('warn', msg);
|
consoleLog('warn', msg);
|
||||||
window.gameWindow.console.error = (msg: string) =>
|
iframe.contentWindow.console.error = (msg: string) =>
|
||||||
consoleLog('error', msg);
|
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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user