Firefox 在哪里存储 sessionStorage 内容
我试图找出 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
localStorage
数据保存在 文件webappsstore.sqlite< /code> 在 Firefox 配置文件中
。有一个有趣的调整,即主机名被还原(
gro.allizom
而不是mozilla.org
),但除此之外,它几乎就是您所期望的。只有一个表:请注意,此结构可能会在未来的 Firefox 版本中发生变化。
至于
sessionStorage
,它只需要持续一个浏览器会话。重新启动浏览器通常会清除它,因此不需要将其存储在数据库中。 Firefox 仍然将其写入磁盘以允许恢复当前浏览会话,即写入sessionstore.js
文件(JSON 格式)。有一个键storage
,它的值是从URL到其对应的sessionStorage
数据的映射。我不确定这些数据是否完整,但考虑到其主要目的是从崩溃中恢复。localStorage
data is saved in the filewebappsstore.sqlite
in the Firefox profile. There is a funny tweak that host names are reverted (gro.allizom
instead ofmozilla.org
) but other than that it is pretty much what you would expect. There is only one table: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 thesessionstore.js
file (JSON format). There is a keystorage
, its value is a map from URLs to their correspondingsessionStorage
data. I am not sure whether this data is complete however given that its main purpose is to recover from crashes.