【问题标题】:Modernizr detection of IndexedDB in iOS-Simulator在 iOS 模拟器中对 IndexedDB 的 Modernizr 检测
【发布时间】:2014-12-26 05:49:37
【问题描述】:

在我的应用程序中,我使用 Modernizr 来检测各种功能。要检测 IndexedDB 是否可用,我使用“Modernizr.indexeddb”。在 iOS 模拟器 (v8.1) 中它返回 false! (它应该返回 true,因为 IndexedDB 从 iOS 8.0 开始可用 - 不过它是 buggy behavior)。

(该应用程序使用 AngularJS、MobileAngularUI 和 jQuery,但这与我认为的问题无关。)

我在 Desktop-Safari 和 Chrome 中检查了同一个应用程序:Modernizr.indexeddb 返回 true。

我通过此网站重新检查了此设备是否支持 indexedDB: https://www.browserleaks.com/modernizr - 它表明在模拟器的 Safari 浏览器中支持 IndexedDB。

为了确保我运行的是最新版本的 Modernizr,我从以下 URL 重新下载了 Modernizr: http://modernizr.com/downloads/modernizr-latest.js

编辑This Pluker 包含一个按钮,您可以在其中检查 Modernizr.indexeddb 的输出。 我在我的 iOS8.1 设备和 8.1 iOS 模拟器上对此进行了测试。在两个设备上,返回值都是 true!

按钮触发该功能:

function checkIndexedDB() {
  alert('Modernizr.indexeddb = ' + Modernizr.indexeddb);
};

为什么我的应用(在 cordova-container 中运行)没有可用的 indexeddb?

【问题讨论】:

    标签: cordova uiwebview ios8 indexeddb modernizr


    【解决方案1】:

    我找到了答案 - IndexedDB 在 Cordova-Applications 中不可用。 (今天的状态:2014 年 10 月 31 日)

    在 iOS8 中引入了一个新组件 WKWebView。 Cordova 仍然使用旧的 UIWebView 组件。他们想切换到新的 WKWebView,but there are some bugs apple has to solve

    不幸的是,WKWebView 中存在一个严重的错误,它无法加载 file:// url,因此阻碍了我们的工作。此功能在设备上的 iOS 8 beta 1 到 3 中运行(它始终在 iOS 8 模拟器中运行),但在那之后就中断了。我不确定这个错误修复的预计到达时间是什么,但它在 Apple 的雷达中(字面意思!)。

    查看更多信息: Does iOS 8 support IndexedDB with UIWebView?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-24
      • 1970-01-01
      • 2015-05-27
      • 1970-01-01
      • 2012-02-19
      • 1970-01-01
      • 2016-11-08
      • 1970-01-01
      相关资源
      最近更新 更多