Localstorage is a particularly useful part of HTML 5 which allows websites to store small amounts of data inside a user's browser in a place that is only accessible to that site. In many ways, it's an extension of the idea behind cookies.
While debugging a LIFDed web application, I tried to do something that should have been simple: dumping all of the data that a site has in localstorage. Unfortunately it wasn't all that straightforward.
Cookie persistence and localstorage
Before you do anything else, make sure that persistent cookies are enabled. In Firefox, that means:
Edit | Preferences | Privacy | History | Keep until: they expire
If you don't do this, then the localstorage database on disk will always be empty as I imagine the data is simply kept in a data structure in memory.
However, if you don't like the idea of persistent cookies for privacy reasons, you can still tell Firefox to clear cookies when it shut downs. Simply select "Clear history when Firefox closes" and then click the Settings button next to it. Localstorage will work as expected until the browser is closed.
Reading the contents of localstorage
- go into your Firefox profile directory (
open the database using sqlite3 (
apt-get install sqlite3on Debian):
dump everything that's in this database:
> .dump webappsstore2
or only show the strings from a given origin (e.g.
> SELECT key, value FROM webappsstore2 WHERE scope = '220.127.116.111.:http:8000';