-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexedDBShim makes Chrome and Firefox use WebSQL #263
Comments
Any updates on this? This pretty much makes this lib unusable on chrome. I don't want my webapp to use WebSQL... Are there any workarounds? |
For info on the requirements before the next release, see #263 . Help is welcome to get things up to speed. Specific browser support is the last item on my list for the release, so feel free to investigate whether the issue still exists with the version in |
Finally getting to take a look at browser-specific issues...
While our code tries to do this for you (more on that below), I should say it is not always completely easy to determine what this is. There may be features now fixed in our polyfill which fail in the native version and there are known cases where it is the other way around even in our best polyfilling environment (currently Node.js followed by Chrome with WebSQL).
Our code shouldn't be attempting to replace the native version automatically except in iOS9 and non-Chrome Android which were determined to be poorly supported. Please subscribe to issue #277, however, regarding these two cases, as I plan to post there shortly. If Dexie is assuming the presence of As far as Can I Use, note that this is oversimplifying a bit--there are well over 1000 tests from the W3C and other sources that we are using to gauge compliance and native implementations are not passing all of these tests (we are not either, but coming close to what is feasible for us to implement, especially in Node; in the browser, specific browsers have their own remaining issues which we need help debugging).
Yes, but see above on what approach I think they should be taking. Btw, for Safari 9, our code automatically attempts to add all interfaces.
The WebSQL code is not run unless you attempt to run it. However, I agree we could probably instead avoid by providing some otherwise empty "shimIndexedDB" object which only had the
See the above paragraph. We could also potentially be patching implementations without any need for WebSQL, btw, though not sure there is any need in Firefox. Note that the other interfaces are not added automatically except for iOS9 and non-Chrome Android or if But again, I agree it doesn't make sense for the
Probably yes, as Chrome's will certainly be faster, and there are a few issues mentioned in the README that our polyfill, as a non-native app, cannot address. There may be some cases, however, where we are more compliant with the spec than with Chrome (and I would like to see about improving our Chrome support as it has a few more failing tests (documented in
That's how it should be working, at least in
There is not usually much need to use anything besides HTH... In sum, further action is warranted in regard to this issue as follows: Avoid adding/exposing |
First, thanks for writing this polyfill that is one of the rare ways that exist to use a decent database in a web browser through a unified API.
I use Dexie.js (an IndexedDB wrapper) and I noticed a strange behavior when using it with IndexedDBShim.
I would expect Dexie.js and IndexedDBShim to use the most accurate underlying database according to the browser and it does not seem to be the case.
I noticed that my code uses always WebSQL, even in Chrome and Firefox that correctly support IndexedDB yet according to Can I use, and it does not work at all on Firefox since it does not support WebSQL. I reported that issue in the Dexie.js project: dexie/Dexie.js#342.
This issue enabled me to understand why it does not work in Firefox, Dexie.js uses IndexedDBShim first whereas IndexedDBShim recommends to use IndexedDB first. It sounds like they use this behavior because of to an issue with Safari 9.
The documentation says that IndexedDBShim does nothing on browsers that support IndexedDB. But it appears that in Firefox it defines the
window.shimIndexedDB
variable anyway and it contains some code using WebSQL that has no chance to work. When the documentation says that it does nothing, does it mean it does not modify thewindow.indexedDB
variable? Is there a reason why thewindow.shimIndexedDB
is defined in the case there is nothing to do such as in Firefox?I also noticed that if I call
window.shimIndexedDB.__useShim()
to make the shim fix issues in browsers with broken or partial implementation (what I need), Chrome uses WebSQL whereas it seems to support IndexedDB. It sounds like it would be better to use IndexedDB in the cases it is correctly supported, wouldn't it?Is there a way to use IndexedDB if its implementation in the current browser is satisfying and the WebSQL binding in other cases?
If it is not the case, I still can detect it manually and use
window.indexedDB
orwindow.shimIndexedDB
according to the browser capacities but who better than IndexedDBShim knows that?Thanks in advance.
The text was updated successfully, but these errors were encountered: