Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 453
the_moon Avatar asked Nov 20 '13 18:11

the_moon


People also ask

Does iOS Safari support IndexedDB?

IndexedDB on Safari on iOS is fully supported on 10-16, partially supported on 8.1-14.5, and not supported on 3.2-7 Safari on iOS versions. IndexedDB on Android Browser is fully supported on 4.4-103, partially supported on None of the versions, and not supported on 2.3-4 Android Browser versions.

Is IndexedDB database supported by all browsers?

Browser SupportThe latest versions of Firefox, Chrome, Opera, Safar, iOS Safari, and Android all fully support IndexedDB, and Internet Explorer and Blackberry feature partial support.

Is IndexedDB deprecated?

The W3C has announced that the Web SQL database is a deprecated local storage specification so web developer should not use this technology any more. indexeddb is an alternative for web SQL data base and more effective than older technologies.

What is IndexedDB vs localStorage?

LocalStorage vs. IndexedDB offers several benefits over localStorage. For instance, IndexedDB doesn't block the DOM when used with a worker, unlike localStorage. However, localStorage is slightly faster than IndexedDB. The API of localStorage is also much easier to get started with, making it the more popular choice.


2 Answers

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.

like image 91
dumbmatter Avatar answered Sep 28 '22 06:09

dumbmatter


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

like image 39
TheAccessMan Avatar answered Sep 28 '22 07:09

TheAccessMan