Firefox 安全错误:“操作不安全." [英] Firefox SecurityError: "The operation is insecure."
问题描述
我正在使用 Backbone.LocalStorage 插件和主干应用程序.它在 chrome 和 safari 中运行良好,但是在 Firefox 中出现以下错误.
I am using Backbone.LocalStorage plugin with backbone app. It is working fine in chrome and safari however, it is giving me below error in firefox.
DOMException [SecurityError: 操作不安全."代码:18nsresult: 0x80530012位置:http://localhost:8000/js/libs/backbone.localStorage/backbone.localStorage.js?version=1453910702146:137]
DOMException [SecurityError: "The operation is insecure." code: 18 nsresult: 0x80530012 location: http://localhost:8000/js/libs/backbone.localStorage/backbone.localStorage.js?version=1453910702146:137]
我正在使用 python simpleHttpServer
I am using python simpleHttpServer
我该如何解决这个错误?
How can I resolve this error?
更新
这是我的代码.
paths: {
'jquery' : 'libs/jquery/dist/jquery',
'underscore' : 'libs/underscore/underscore',
'backbone' : 'libs/backbone/backbone',
'localStorage' : 'libs/backbone.localStorage/backbone.localStorage',
'text' : 'plugins/text'
}
这是使用 localStorage 的集合.
Here is collection where localStorage is used.
var Items = Backbone.Collection.extend({
model: SomeModel,
localStorage: new Backbone.LocalStorage('items'),
});
更新 2
我使用的是 Firefox 36.
I am using firefox 36.
更新 3
似乎是 CORS 问题,但我的 Firefox 版本是 36.应该没问题.
It seems like it is a CORS issue but my firefox version is 36. Which should be fine.
更新 4
我在 firefox nightly version 44 中也遇到了这个错误.我也将我的 firefox 更新到了 version 44.还是同样的错误.
I am also getting this error in firefox nightly version 44. I also updated my firefox to version 44. Still same error.
推荐答案
确保 Firefox 已启用 cookie.该设置可以在菜单/选项/隐私/历史
Make sure Firefox has cookies enabled. The setting can be found under Menu/Options/Privacy/History
在下拉列表中,选择记住历史记录",或者如果您更喜欢使用自定义历史记录设置,但选择选项接受来自站点的 cookie
In the dropdown, select either 'Remember History' or if You prefer use custom settings for history, but select option Accept cookies from sites
希望有帮助.
这篇关于Firefox 安全错误:“操作不安全."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!