我一直在使用网络应用程序并使用本地存储。但对于一些 Firefox 用户,我注意到他们遇到了以下错误:
NS_ERROR_FILE_CORRUPTED: Component returned failure code: 0x8052000b (NS_ERROR_FILE_CORRUPTED) [nsIDOMStorage.setItem]
当它调用该函数时:
function setLocalStorageItem(key, value){
localStorage.setItem(key, JSON.stringify(value));
}
这是避免此错误的方法吗?
最佳答案
操作系统崩溃后,Firefox 配置文件文件夹中的文件可能会损坏并导致无法正常运行的网站(讽刺的是,在我的例子中是 Firefox 市场)。此处,webappsstore.sqlite
受到影响。
正如用户 @Oli 在 Ask Ubuntu 中所述
Firefox stores its HTML5 data in a file called webappsstore.sqlite. That's sitting in your profile directory which lurks somewhere in ~/.mozilla/firefox/....default/ (depending on what your profile is called).
Move that out the way and restart Firefox and everything will come back to life.
更多:https://developer.mozilla.org/en/dom/storage
如果从您的个人资料文件夹中删除/移出,Firefox 会构建一个新的、经过清理的 webappsstore.sqlite
文件。 为我工作。
有关在哪里可以找到您的个人资料文件夹的信息可以是 accessed here .
关于javascript - 本地存储错误 - NS_ERROR_FILE_CORRUPTED - firefox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18877643/