mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2026-02-06 11:17:36 +00:00
beforeunload update
This commit is contained in:
parent
8184ba800b
commit
84d09b8e0f
@ -1159,6 +1159,11 @@ class EmulatorJS {
|
||||
}, 0);
|
||||
});
|
||||
this.addEventListener(window, "beforeunload", (e) => {
|
||||
if (window.EJS_askBeforeUnload) {
|
||||
e.preventDefault();
|
||||
e.returnValue = '';
|
||||
return
|
||||
}
|
||||
if (!this.started) return;
|
||||
this.callEvent("exit");
|
||||
});
|
||||
|
||||
@ -259,6 +259,7 @@
|
||||
window.EJS_DEBUG_XX = enableDebug;
|
||||
window.EJS_disableDatabases = true;
|
||||
window.EJS_threads = enableThreads;
|
||||
window.EJS_askBeforeUnload = false;
|
||||
if (browserMode) {
|
||||
window.EJS_browserMode = browserMode;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user