最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Alternative to IndexedDB in not supported browsers? SafariiOS Saf-Chrome - Stack Overflow

programmeradmin5浏览0评论

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: /. 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!

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!

Share Improve this question asked Nov 20, 2013 at 18:22 the_moonthe_moon 5632 gold badges7 silver badges21 bronze badges 1
  • 2 But I need to store a great amount of data in a kind of a sorted way... – the_moon Commented Nov 21, 2013 at 16:34
Add a comment  | 

3 Answers 3

Reset to default 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.

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

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.

  • NeDB used heavily, but deprecated
  • PouchDB
  • RxDB

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.

发布评论

评论列表(0)

  1. 暂无评论