Firefox 在哪里存储 javascript/HTML localStorage?

发布于 2024-11-29 17:06:53 字数 236 浏览 0 评论 0原文

我已经制作了一个简单 Web 应用程序的高级功能原型,并且延迟已将其推向“上线”状态。

目前,它仅使用 JavaScript 的 localStorage 工具来跟踪正在发生的情况,但由于偏执,我们不希望它被损坏导致数据丢失(这确实感觉有点粗略)与服务器对话)。

Firefox 在哪里保存其 localStorage 数据库(我认为是 SQLite,但我就是找不到它)?

I have made an advanced functional prototype of a simple web application, and delays have pushed this into the position of going "live".

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).

Where does Firefox keep its localStorage database (I think it's SQLite, but I just can't find it)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

如果没有 2024-12-06 17:06:53

DOM存储数据存储在配置文件中的webappsstore.sqlite文件中
文件夹。

§ localStorage

The DOM storage data is stored in the webappsstore.sqlite file in the profile
folder.

§ localStorage

为你拒绝所有暧昧 2024-12-06 17:06:53

在 Mac OS X 上,webappsstore.sqlite 位于 ~/Library/Application Support/Firefox/Profiles/xxxxxxxx.default/ 下(其中 xxxxxxxx 是根据 Firefox 配置文件教程)。

我使用 Command Line 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

请参阅 Chrome 存储位置的 HTML5 WebStorage 数据是如何物理存储的?。 Chrome 对每个主机名和协议使用单独的 sqlite 文件,而 Firefox 在范围列中使用反向主机名和协议。

有关 Opera 存储,请参阅 sessionStorage 和 localStorage 存储在哪里?地点。 Opera 使用 XML 索引文件和单独的 XML 文件来存储 Base64 编码数据。

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 ).

I used the Command Line Shell For SQLite to look around. Assuming www.example.com was a real site and the only site using localstorage, you can run these commands:

$ 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.

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.

月隐月明月朦胧 2024-12-06 17:06:53

LSNG 开始,本地存储也可以在配置文件目录中找到存储/默认/

As of LSNG, local storage is also found in the profile directory under storage/default/.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文