Firefox 在哪里存储 javascript/HTML localStorage?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7079075/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where does Firefox store javascript/HTML localStorage?
提问by Stephen
I have made an advanced functional prototype of a simple web application, and delays have pushed this into the position of going "live".
我制作了一个简单的 Web 应用程序的高级功能原型,延迟将其推到了“上线”的位置。
At the moment, it just uses JavaScript's localStorage
facility to keep track of what's happening, but due to paranoia, we don't want it to be corrupted causing loss of data (it certainly feels a bit sketchy never talking to a server).
目前,它只是使用 JavaScript 的localStorage
工具来跟踪正在发生的事情,但由于偏执,我们不希望它被破坏而导致数据丢失(从不与服务器交谈肯定感觉有点粗略)。
Where does Firefox keep its localStorage
database (I think it's SQLite, but I just can't find it)?
Firefox 在哪里保存它的localStorage
数据库(我认为它是 SQLite,但我找不到它)?
回答by Vlad
The DOM storage data is stored in the
webappsstore.sqlite
file in the profile folder.
DOM 存储数据存储在
webappsstore.sqlite
配置文件文件夹中的文件中。
回答by Kevin Hakanson
On Mac OS X, the webappsstore.sqlite
is located under ~/Library/Application Support/Firefox/Profiles/xxxxxxxx.default/
(where xxxxxxxx is random according to Firefox Profile Tutorial).
在 Mac OS X 上,webappsstore.sqlite
位于~/Library/Application Support/Firefox/Profiles/xxxxxxxx.default/
(根据Firefox Profile Tutorial中 xxxxxxxx 是随机的)。
I used the Command Line Shell For SQLiteto look around. Assuming www.example.com was a real site and the only site using localstorage, you can run these commands:
我使用命令行 Shell For SQLite环顾四周。假设 www.example.com 是一个真实站点,并且是唯一使用 localstorage 的站点,您可以运行以下命令:
$ sqlite3 webappsstore.sqlite
sqlite> .tables
webappsstore2
sqlite> .schema
CREATE TABLE webappsstore2 (scope TEXT, key TEXT, value TEXT, secure INTEGER, owner TEXT);
CREATE UNIQUE INDEX scope_key_index ON webappsstore2(scope, key);
sqlite> select * from webappsstore2;
moc.elpmaxe.www.:http:80|stringkey|value|0|
moc.elpmaxe.www.:http:80|jsonkey|{"key","value"}|0|
sqlite> .exit
See How is HTML5 WebStorage data physically stored?for the Chrome storage location. Chrome uses individual sqlite files per hostname and protocol, where Firefox uses the reversed hostname and protocol in the scope column.
请参阅HTML5 WebStorage 数据是如何物理存储的?用于 Chrome 存储位置。Chrome 使用每个主机名和协议的单独 sqlite 文件,其中 Firefox 在范围列中使用反向的主机名和协议。
See Where the sessionStorage and localStorage stored?for the Opera storage location. Opera uses an XML index file and individual XML files for the Base64 encoded data.
请参阅sessionStorage 和 localStorage 存储在哪里?Opera 存储位置。Opera 对 Base64 编码数据使用 XML 索引文件和单独的 XML 文件。
回答by Sanghyun Lee
On Windows, you can find it in here
在 Windows 上,您可以在此处找到它
%appdata%\Mozilla\Firefox\Profiles\xxxxxxx.default\webappsstore.sqlite
回答by www.admiraalit.nl
See MDN page on Window.localStorage:
请参阅Window.localStorage 上的 MDN 页面:
Starting with iOS 5.1, Safari Mobile stores localStorage data in the cache folder
从 iOS 5.1 开始,Safari Mobile 将 localStorage 数据存储在缓存文件夹中