// Keeps the prefs folder (/libsdl, where SDL puts it on the web) in IndexedDB, loading it before the game starts so // settings and saves are there when it reads them. The game writes it back after every save. Module.preRun = Module.preRun || []; Module.preRun.push(() => { FS.mkdir("/libsdl"); FS.mount(IDBFS, {}, "/libsdl"); addRunDependency("prefs"); FS.syncfs(true, () => removeRunDependency("prefs")); });