Firefox 在哪里存储 sessionStorage 内容

发布于 2024-12-07 07:12:47 字数 583 浏览 0 评论 0原文

我试图找出 Firefox 存储 sessionStorage 内容的位置,但一直找不到。我希望它位于 SqLite 数据库中,就像存储的 localStorage 内容一样,但我一直无法找到它。

到目前为止,我已经搜索了配置文件文件夹中的所有典型“.sqlite”文件,例如 cookies.sqlite 和 content-prefs.sqlite 等,但它们似乎没有 sessionStorage 数据。

我还尝试打开 Firefox 据称创建的特殊内存数据库 - https ://developer.mozilla.org/en/XPCOM_Interface_Reference/mozIStorageService#openSpecialDatabase%28%29但是我找不到枚举数据库中存在的表的方法。我可以连接到内存数据库,但我不知道如何找出内存数据库中存在的表等...

任何帮助表示感谢

,谢谢,

I am trying to find out where Firefox stores the sessionStorage content but have been unable to find so. I am expecting it to be in a SqLite database like the localStorage content is stored but I have not been able to find it.

So far, I have searched all the typical ".sqlite" files in the profile folder such as cookies.sqlite and content-prefs.sqlite etc but they do not seem to have the sessionStorage data.

I also tried to open the special in-memory database that Firefox supposedly creates - https://developer.mozilla.org/en/XPCOM_Interface_Reference/mozIStorageService#openSpecialDatabase%28%29 but I could not find a way to enumerate the tables present in the database. I could get a connection to the in memory database but i have no clue as to how to figure out the tables etc. that are present in that in-memory database...

Any help is appreciated

Thanks,

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

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

发布评论

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

评论(1

夏见 2024-12-14 07:12:47

localStorage 数据保存在 文件 webappsstore.sqlite< /code> 在 Firefox 配置文件中。有一个有趣的调整,即主机名被还原(gro.allizom 而不是 mozilla.org),但除此之外,它几乎就是您所期望的。只有一个表:

CREATE TABLE webappsstore2 (
  scope TEXT,
  key TEXT,
  value TEXT,
  secure INTEGER,
  owner TEXT
)

请注意,此结构可能会在未来的 Firefox 版本中发生变化。

至于sessionStorage,它只需要持续一个浏览器会话。重新启动浏览器通常会清除它,因此不需要将其存储在数据库中。 Firefox 仍然将其写入磁盘以允许恢复当前浏览会话,即写入 sessionstore.js 文件(JSON 格式)。有一个键storage,它的值是从URL到其对应的sessionStorage数据的映射。我不确定这些数据是否完整,但考虑到其主要目的是从崩溃中恢复。

localStorage data is saved in the file webappsstore.sqlite in the Firefox profile. There is a funny tweak that host names are reverted (gro.allizom instead of mozilla.org) but other than that it is pretty much what you would expect. There is only one table:

CREATE TABLE webappsstore2 (
  scope TEXT,
  key TEXT,
  value TEXT,
  secure INTEGER,
  owner TEXT
)

Note that this structure might change in a future Firefox version.

As to sessionStorage, it only needs to persist for one browser session. Restarting the browser normally clears it, so it doesn't need to be stored in a database. Firefox still writes it to disk to allow restoring the current browsing session, namely to the sessionstore.js file (JSON format). There is a key storage, its value is a map from URLs to their corresponding sessionStorage data. I am not sure whether this data is complete however given that its main purpose is to recover from crashes.

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