Skip to content

Instantly share code, notes, and snippets.

@jaredhirsch
Last active August 29, 2015 14:10
Show Gist options
  • Save jaredhirsch/c065bd2b487a3535504e to your computer and use it in GitHub Desktop.
Save jaredhirsch/c065bd2b487a3535504e to your computer and use it in GitHub Desktop.
exporting firefox history

goal: export my history into a JSON blob that can be imported into a web service.

exporting bookmarks in FF is very easy, but history is a bit harder.

  1. find your profile

this sumo page suggests that you go to about:support and click on the 'show in finder' button to find your profile

  1. extract history from the places.sqlite sqlite3 database

This blog suggests the following SQL query:

SELECT
  datetime(moz_historyvisits.visit_date/1000000,’unixepoch’),
  moz_places.url,
  moz_places.title
FROM
  moz_places,
  moz_historyvisits
WHERE
  moz_places.id = moz_historyvisits.place_id;

Or, as a one-liner, SELECT datetime(moz_historyvisits.visit_date/1000000,’unixepoch’), moz_places.url, moz_places.title FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id;.

However, I'm stuck on this step, having trouble exporting the timestamp in a pretty format. To be continued.

There's also a forensics blog with a bunch of similar FF history/places database queries. Interesting stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment