indexeddbshim / indexeddbshim/IndexedDBShim

The shim does not work on Safari 8 or 9

Open
#327 3 comments 0 reactions 0 assignees View on GitHub
Bug-environment support
Dominant language
JavaScript
Stars
979
Forks
191
Avg merge
55m
Merged PRs (30d)
2

Description

Tested on Browserstack on iOS v9 Safari ( an IPhone 6S Plus).

### Safari 9
```html

shimIndexedDB.__useShim();
```
...does not do its job to patch the browser no matter manually calling shimIndexedDB.__useShim() or not.

Expected behavior: window.indexedDB references the shim instead of the native.
Actual behavior: window.indexedDB still is native.

But the following works perfectly:

```html

shimIndexedDB.__useShim();
```

### Safari 8
As Safari 8 blocks from patching window.indexedDB, it will not be enough to call shimIndexedDB.__useShim() to support Safari 8. This is not something that can be solved within the shim. But we had a solution for it in Dexie 1.x where it automatically used the shim in case it was included.

Now with Dexie 2.x, the developer will have to manually connect the shim with Dexie.dependencies. I have found no way of doing this in IndexedDBShim 3.x as it does not expose IDBKeyRange publicly what I could see. Dexie 1.x solved this with IndexedDBShim 2.x under the hood for anyone who had included the shim, but due to [this comment](https://github.com/axemclion/IndexedDBShim/issues/263#issuecomment-294338025) I removed that part in Dexie 2.x.

### My Current Recommendations

I've put a recommended way for Dexie users to support older versions of Safari here: https://stackoverflow.com/a/50855488/1282923

Please advice how this could be improved.

Contributor guide

Open the contributing guide

Research direction

Reproduce the Safari 8 and 9 cases using the dist/indexeddbshim.js entry point and the shimIndexedDB.__useShim() call. Compare window.indexedDB and the exposed IDBKeyRange behavior with the working 2.x build; done means the supported Safari integration path is documented or the shim behavior is corrected and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.