【问题标题】:Could not set localStorage for https URL from Firefox extension无法为 Firefox 扩展中的 https URL 设置 localStorage
【发布时间】:2012-10-09 21:59:20
【问题描述】:

http://fartersoft.com/blog/2011/03/07/using-localstorage-in-firefox-extensions-for-persistent-data-storage/

我已经使用上面的链接代码为 Firefox 扩展中的 URL 设置了 localStorage。

如果我使用 URL 作为“https://example.com”,显示错误为

错误:未捕获的异常:[Exception...“操作不安全。”

【问题讨论】:

  • 刚刚在 Firefox 14 中尝试过,对我来说效果很好。您在使用其他 Firefox 版本吗?如果注意 - 请添加您实际运行的代码。

标签: firefox firefox-addon local-storage


【解决方案1】:

使用 https:// 方案保存的 Vales 是隔离的,因此您无法从只是 http:// 的位置访问它们

http://htmlui.com/blog/2011-08-23-5-obscure-facts-about-html5-localstorage.html

【讨论】:

  • 问题是关于Firefox扩展,扩展可以访问任何他们想要的本地存储对象。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多