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

前端 未结 2 820
孤城傲影
孤城傲影 2021-02-08 07:38

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 avai

2条回答
  •  天涯浪人
    2021-02-08 07:59

    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.

提交回复
热议问题