Fun with Firefox and sqlite

For anyone who wants to practice SQL, Firefox stores a lot of info in sqlite. You can cd into your Firefox profile directory and then load any of the databases in sqlite:

content-prefs.sqlite
cookies.sqlite
favicons.sqlite
formhistory.sqlite
permissions.sqlite
places.sqlite
storage.sqlite
storage-sync.sqlite
webappsstore.sqlite

Example, the browsing history is stored in places.sqlite:

$ sqlite3 places.sqlite

Or for cookies:

$ sqlite3 cookies.sqlite
sqlite> SELECT * FROM moz_cookies LIMIT 10;

See also, this sqlite cheatsheet and the post below.

Here’s an idea for a sqlite/SQL learning project that would be fun:

Write a script to count how many times you search Google (or other search engine) per day and create a report.

The browsing history is stored in a variety of tables. I’m not sure what’s in all of them, but it looked interesting from a quick glance.

moz_anno_attributes
moz_historyvisits
moz_keywords
moz_annos
moz_host
moz_meta
moz_bookmarks
moz_inputhistory
moz_origins
moz_bookmarks_deleted
moz_items_annos
moz_places