MCPcopy Index your code
hub / github.com/EmulatorJS/EmulatorJS / getLocalStorageKey

Method getLocalStorageKey

data/src/emulator.js:4144–4156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4142 localStorage.setItem(this.getLocalStorageKey(), JSON.stringify(coreSpecific));
4143 }
4144 getLocalStorageKey() {
4145 let identifier = (this.config.gameId || 1) + "-" + this.getCore(true);
4146 if (typeof this.config.gameName === "string") {
4147 identifier += "-" + this.config.gameName;
4148 } else if (typeof this.config.gameUrl === "string" && !this.config.gameUrl.toLowerCase().startsWith("blob:")) {
4149 identifier += "-" + this.config.gameUrl;
4150 } else if (this.config.gameUrl instanceof File) {
4151 identifier += "-" + this.config.gameUrl.name;
4152 } else if (typeof this.config.gameId !== "number") {
4153 console.warn("gameId (EJS_gameID) is not set. This may result in settings persisting across games.");
4154 }
4155 return "ejs-" + identifier + "-settings";
4156 }
4157 preGetSetting(setting) {
4158 if (window.localStorage && !this.config.disableLocalStorage) {
4159 let coreSpecific = localStorage.getItem(this.getLocalStorageKey());

Callers 4

saveSettingsMethod · 0.95
preGetSettingMethod · 0.95
getCoreSettingsMethod · 0.95
loadSettingsMethod · 0.95

Calls 1

getCoreMethod · 0.95

Tested by

no test coverage detected