【问题标题】:Is there a way to view the contents of localStorage on the iPad?有没有办法在 iPad 上查看 localStorage 的内容?
【发布时间】:2013-02-27 06:09:12
【问题描述】:

在设置/Safari 中,有一个数据库条目,可让我查看在我的 iPad 上创建的数据库(不是它们的内容,而是它们的大小和来源)。

但是,我看不到任何方法可以查看 localStorage 中的内容。我正在使用控制台访问 Safari 中的 localStorage(开发 > 显示 Web 检查器并单击存储选项卡)。

有没有办法在我缺少的 iPad 上查看 localStorage?

谢谢

【问题讨论】:

    标签: javascript ipad html local-storage


    【解决方案1】:

    如果您可以访问 Apple 计算机,则可以使用 Safari 的 Web Inspector 检查 iPad 上的内容 - 包括 localStorage 和 sessionStorage。

    • 在您的 iPad 中,转到 Settings > Safari > Advanced 并打开 Allow Remote Debugging

    • 然后,将其插入您的 Apple 计算机。

    • 在 Safari 中,转到您的设置并选择 Advanced。选中 Show Develop menu in the menu bar 复选框。

    • 现在,如果您单击顶部菜单栏上的develop,您将能够看到您的 iPad。您将能够像 Webkit 的 Web Inspector 一样检查元素并使用它。

    不过,目前它没有使用标准的 Webkit 检查器 - 和 many people have an issue with this.

    【讨论】:

      【解决方案2】:

      您可以使用 javascript 命令访问 localStorage。 (参考https://developer.mozilla.org/en/dom/storage#localStorage。)

      要远程调试,请尝试使用http://jsconsole.com/

      此外,您可以在 iPad 设置 -> Safari 下启用查看 console.log() 输出,这可能有助于您在本地进行调试。

      【讨论】:

      • 所以除了通过控制台听起来没有别的办法。谢谢!
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-02
      • 2015-11-02
      • 2011-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-30
      相关资源
      最近更新 更多