Ok, so there’s two errors and I bet they are related:
This line:
window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
Modifying the window like that from within an iframe is probably not allowed. You can try hacking your way around it. Replace preInit with:
preInit: [function() {
/* Mount filesystem on preinit */
var dir = DMSYS.GetUserPersistentDataRoot();
FS.mkdir(dir);
Module._preloadAndCallMain();
}],
Save games will not work I guess, but the game should start. You can perhaps also try not writing to window
:
preInit: [function() {
/* Mount filesystem on preinit */
var dir = DMSYS.GetUserPersistentDataRoot();
FS.mkdir(dir);
// If IndexedDB is supported we mount the persistent data root as IDBFS,
// then try to do a IDB->MEM sync before we start the engine to get
// previously saved data before boot.
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
if (Module.persistentStorage && indexedDB) {
FS.mount(IDBFS, {}, dir);
// Patch FS.close so it will try to sync MEM->IDB
var _close = FS.close; FS.close = function(stream) { var r = _close(stream); Module.persistentSync(); return r; }
// Sync IDB->MEM before calling main()
Module.preSync(function() {
Module._preloadAndCallMain();
});
} else {
Module._preloadAndCallMain();
}
}],