Where does Firefox store javascript/HTML localStorage?

此生再无相见时 提交于 2019-11-27 20:32:02
Vlad

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

§ localStorage

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

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.

On Windows, you can find it in here

%appdata%\Mozilla\Firefox\Profiles\xxxxxxx.default\webappsstore.sqlite

See MDN page on Window.localStorage:

Starting with iOS 5.1, Safari Mobile stores localStorage data in the cache folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!