Alternative to IndexedDB in not supported browsers? Safari/iOS Saf-Chrome
Asked Answered
I

3

12

I have a working sample with IndexedDB that works perfect for my Desktop Chrome. Nevertheless, my main aim is to develop for iOS devices (Chrome-Safari) and this API isn't available there yet. What should I do?

I have seen this Polyfill: http://nparashuram.com/IndexedDBShim/. But, I tested it with my iPod Touch 5th Gen and somehow the 19th test doesn't work...

Should I use WebSQL which was deprecated?

I liked the idea of the Polyfill but that it not working for me...

Are there any plans to support IndexedDB in the future for all the non-supported browsers?

Thanks!

Irfan answered 20/11, 2013 at 18:22 Comment(1)
But I need to store a great amount of data in a kind of a sorted way...Irfan
F
17

Here is another similar polyfill you can try, but in my (albeit limited) experience, both polyfills are buggy/incomplete. They both also have many open issues on GitHub of people reporting problems. And when I tested one of them (I forget which one) it was significantly slower than native IndexedDB.

Maybe it's possible to create a decent polyfill, but the current ones don't seem to be doing the job.

Should I use WebSQL which was deprecated?

The problem with WebSQL is that it's never going to be supported in IE or Firefox. You could probably get away with WebSQL if you're only targeting mobile browsers, at least until Firefox OS or Windows Phone grabs significant market share.

Are there any plans to support IndexedDB in the future for all the non-supported browsers?

Let's be clear. You're asking about Apple, since everyone else supports IndexedDB in their latest browser (iOS Chrome uses Apple's rendering engine because Apple won't let them do anything else).

Not only does Apple not support IndexedDB, they haven't publicly said anything about it (as far as I can tell... and I have done a fair amount of searching). Which seems pretty weird. So as best I can tell, nobody has any idea if Apple ever plans to support IndexedDB. The conspiracy theorist in me thinks maybe they're trying to sabotage HTML5 apps to force people to write native apps, but that's purely speculation.

In total, this leaves us developers in a pretty shitty situation. There is no good cross-platform solution. I recommend you complain to Apple about it. That's what I've done, and I've asked my users who want to use my IndexedDB-based app on iOS to do the same. Still no word from Apple.

UPDATE - Indexeddb is now supported in iOS 8 as stated in WWDC 2014 - but unfortunately it's broken pretty badly.

Foulmouthed answered 21/11, 2013 at 1:5 Comment(6)
I also agree the conspiracy theory that Apple is intentionally sabotage HTML5 app to force use their native app. Here chromestatus.com/features/6507459568992256 records safari as "public skepticism", previously was "public oppose". I dont think apple will implement IndexedDB within couple years. websql in safari has bug on quota grant.Gist
Thanks to both! Yes, I was talking about Apple... They always put stones on my way... A big one this time... I have not seen anything from Apple about IndexedDB either. Where can I complain?Irfan
@KyawTun , what do you mean with quota grant? In case I would only care about Apple, isn't WebSQL the way to go? Are there other alternatives for storing great amount of data, sorted, in the browser?Irfan
for ios quota grant problem see here bitbucket.org/ytkyaw/ydn-db/issue/76/… I don't see alternative for websql for iosGist
Can i use shows that it will be supported in Safari 8. But i can't find any source. Is there any feedback from apple?Penhall
UPDATE - indexeddb is showing to be released in IOS safari 8 desktop and mobile versions... caniuse.com/#feat=indexeddbFiona
D
1

Looks like IndexedDB is not working as web app (pinned to the home screen). Works inside Safari.

Detect answered 20/9, 2014 at 13:31 Comment(0)
T
0

IndexedDB was never be made to be directly used by developers. It is more like an API that can be used to build a "real" database on top of it. Nowadays there are many alternatives that you could use instead.

If you still need to use IndexedDB, at least I would recommend to use a wrapper like dexie.js which at least makes it easier.

Torietorii answered 2/12, 2022 at 12:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.