mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2024-09-20 02:46:23 +00:00
ability to disable localStorage (#764)
This commit is contained in:
parent
e703fab651
commit
29dff80731
2 changed files with 9 additions and 3 deletions
|
@ -3744,7 +3744,7 @@ class EmulatorJS {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
saveSettings() {
|
saveSettings() {
|
||||||
if (!window.localStorage || !this.settingsLoaded) return;
|
if (!window.localStorage || this.config.disableLocalStorage || !this.settingsLoaded) return;
|
||||||
const coreSpecific = {
|
const coreSpecific = {
|
||||||
controlSettings: this.controls,
|
controlSettings: this.controls,
|
||||||
settings: this.settings,
|
settings: this.settings,
|
||||||
|
@ -3758,7 +3758,12 @@ class EmulatorJS {
|
||||||
localStorage.setItem("ejs-"+this.getCore()+"-settings", JSON.stringify(coreSpecific));
|
localStorage.setItem("ejs-"+this.getCore()+"-settings", JSON.stringify(coreSpecific));
|
||||||
}
|
}
|
||||||
loadRewindEnabled() {
|
loadRewindEnabled() {
|
||||||
if (!window.localStorage) return;
|
if (!window.localStorage || this.config.disableLocalStorage) {
|
||||||
|
if (this.config.defaultOptions && this.config.defaultOptions.rewindEnabled) {
|
||||||
|
return this.config.defaultOptions.rewindEnabled === 'enabled';
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
let coreSpecific = localStorage.getItem("ejs-"+this.getCore()+"-settings");
|
let coreSpecific = localStorage.getItem("ejs-"+this.getCore()+"-settings");
|
||||||
try {
|
try {
|
||||||
coreSpecific = JSON.parse(coreSpecific);
|
coreSpecific = JSON.parse(coreSpecific);
|
||||||
|
@ -3772,7 +3777,7 @@ class EmulatorJS {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
loadSettings() {
|
loadSettings() {
|
||||||
if (!window.localStorage) return;
|
if (!window.localStorage || this.config.disableLocalStorage) return;
|
||||||
this.settingsLoaded = true;
|
this.settingsLoaded = true;
|
||||||
let ejs_settings = localStorage.getItem("ejs-settings");
|
let ejs_settings = localStorage.getItem("ejs-settings");
|
||||||
let coreSpecific = localStorage.getItem("ejs-"+this.getCore()+"-settings");
|
let coreSpecific = localStorage.getItem("ejs-"+this.getCore()+"-settings");
|
||||||
|
|
|
@ -110,6 +110,7 @@
|
||||||
config.screenRecording = window.EJS_screenRecording;
|
config.screenRecording = window.EJS_screenRecording;
|
||||||
config.externalFiles = window.EJS_externalFiles;
|
config.externalFiles = window.EJS_externalFiles;
|
||||||
config.disableDatabases = window.EJS_disableDatabases;
|
config.disableDatabases = window.EJS_disableDatabases;
|
||||||
|
config.disableLocalStorage = window.EJS_disableLocalStorage;
|
||||||
|
|
||||||
if (typeof window.EJS_language === "string" && window.EJS_language !== "en-US") {
|
if (typeof window.EJS_language === "string" && window.EJS_language !== "en-US") {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue