I’ve just received this error when trying to sync to the file system:
undefined is not an object (evaluating 'IDBFS.indexedDB().open')
My JSLIB:
var HandleIO = {
WindowAlert : function(message)
{
window.alert(Pointer_stringify(message));
},
SyncFiles : function()
{
window.alert('syncfiles called');
FS.syncfs(false,function (err) {
window.alert('syncfiles finished:'+err);
});
}
};
mergeInto(LibraryManager.library, HandleIO);
My save code
public void Save(){
try
{
BinaryFormatter bin = new BinaryFormatter();
using( FileStream file = File.Open( this.filename, FileMode.OpenOrCreate ) )
{
bin.Serialize( file, this.data );
bin.Serialize( file, this.nVersionNumber );
}
}
catch( Exception ex )
{
Debug.Log( String.Format("Failed to save file {0}:{1}", filename,ex.ToString() ) );
}
if( Application.platform==RuntimePlatform.WebGLPlayer )
{
// if webgl - synch javascript
SyncFiles();
}
}
Browser: Safari10.1
Seems fine on Chrome.
Unity:5.6
What can I do to fix this?