Rename to EJS_disableAutoUnload

This commit is contained in:
Ethan O'Brien 2025-10-13 18:09:36 -05:00
parent 84d09b8e0f
commit 5ab0ebf025
No known key found for this signature in database
GPG Key ID: 1B43B4E93824E611
2 changed files with 3 additions and 2 deletions

View File

@ -127,6 +127,7 @@
config.browserMode = window.EJS_browserMode;
config.shaders = Object.assign({}, window.EJS_SHADERS, window.EJS_shaders ? window.EJS_shaders : {});
config.fixedSaveInterval = window.EJS_fixedSaveInterval;
config.disableAutoUnload = window.EJS_disableAutoUnload;
let systemLang;
try {

View File

@ -1159,9 +1159,9 @@ class EmulatorJS {
}, 0);
});
this.addEventListener(window, "beforeunload", (e) => {
if (window.EJS_askBeforeUnload) {
if (this.config.disableAutoUnload) {
e.preventDefault();
e.returnValue = '';
e.returnValue = "";
return
}
if (!this.started) return;