在不支持的浏览器中替代IndexedDB? Safari / iOS Saf-Chrome [英] Alternative to IndexedDB in not supported browsers? Safari/iOS Saf-Chrome

查看:869
本文介绍了在不支持的浏览器中替代IndexedDB? Safari / iOS Saf-Chrome的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用IndexedDB的工作示例,适用于我的Desktop Chrome。尽管如此,我的主要目标是开发iOS设备(Chrome-Safari),并且此API尚不可用。
我该怎么办?



我已经看到这个Polyfill: http:/ /nparashuram.com/IndexedDBShim/ 。但是,我用我的iPod Touch 5th Gen进行了测试,第19次测试不起作用... ...
$ b

我应该使用已废弃的WebSQL吗?



我喜欢Polyfill的想法,但它不适合我...

未来是否有计划支持所有不支持的浏览器使用IndexedDB?



谢谢!

解决方案

这里是另一个类似的polyfill你可以尝试,但在我(虽然有限)的经验中,两个polyfill都是错误的/不完整的。他们在GitHub上也有很多关于报告问题的人的公开问题。当我测试其中的一个时(我忘记了哪一个),它比原生的IndexedDB慢得多。

可能有可能创建一个像样的polyfill,但是现有的polyfill 'b
$ b


我应该使用已废弃的WebSQL吗?

WebSQL的问题在于它永远不会在IE或Firefox中受支持。如果您只是针对移动浏览器,至少在Firefox OS或Windows Phone抢占大量市场份额之前,您可能会放弃使用WebSQL。

>有没有计划在未来支持所有不受支持的浏览器的IndexedDB?


让我们清楚。你问的是苹果,因为其他人都在最新的浏览器中支持IndexedDB(iOS Chrome使用苹果公司的渲染引擎,因为苹果公司不会让他们做任何事情)。

Apple不仅不支持IndexedDB,他们还没有公开表示过任何关于它的事情(据我所知...并且我已经做了大量搜索)。这似乎很奇怪。据我所知,没有人知道Apple是否计划支持IndexedDB。我的阴谋论者认为,也许他们试图破坏HTML5应用程序以迫使人们编写本地应用程序,但这完全是推测。



总的来说,这让我们开发人员在一个相当糟糕的情况下。没有好的跨平台解决方案。我建议你向苹果公司抱怨。这就是我所做的,并且我已经要求我的用户在iOS上使用基于IndexedDB的应用程序来执行相同的操作。苹果仍然没有提供任何信息。

更新 - 现在在iOS 8中支持Indexeddb,如WWDC 2014所述 - 但不幸的是它坏了很多


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!

解决方案

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.

这篇关于在不支持的浏览器中替代IndexedDB? Safari / iOS Saf-Chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆