dexie / Dexie.js

A Minimalistic Wrapper for IndexedDB
https://dexie.org
Apache License 2.0
11.49k stars 642 forks source link

Wierd Safari (cntd) #380

Open neville9763 opened 7 years ago

neville9763 commented 7 years ago

Hi

Am having an issue with mobile Safari (ios 9.3.5), have read thru #63 and #303 and have implemented the code as suggested:

//add db shim for ios
if(/(iPhone|iPod|iPad)/i.test(navigator.userAgent)) { 

    // Force shim
    //window.shimIndexedDB.__debug(true);
    window.shimIndexedDB.__useShim();

    Dexie.dependencies.indexedDB = window.shimIndexedDB;
    Dexie.dependencies.IDBKeyRange = window.shimIndexedDB.modules.IDBKeyRange;

} else {

    // Force native
    Dexie.dependencies.indexedDB = indexedDB;
    Dexie.dependencies.IDBKeyRange = IDBKeyRange;

}

I have used the shim from https://github.com/axemclion/IndexedDBShim.

When forcing use of the shim (using __useShim), the object shimIndexedDB is created as expected but shimIndexedDB.modules.IDBKeyRange remains undefined (also window.shimIndexedDB.modules.IDBKeyRange and self.shimIndexedDB.modules.IDBKeyRange are also undefined).

On other platforms, no issues.

Anybody have any suggestions about how I can try and resolve this or where I can find IDBKeyRange?

Thanks

Neville

dfahlander commented 7 years ago

Ok, seems shimIndexedDB of different versions have different API. Have you tried using shimIndexedDB.constructor.modules.IDBKeyRange? Which version of the shim are you using?

pesimeao commented 7 years ago

Hello,

Any update on this?