Fun with URL History

Analysing Firefox URL history: why not?

Fun with URL History
Using DB Browser for SQLite to extract URLs from Firefox history (Photo Credit: TomKCC0 1.0)

You can obtain a list of unique URLs visited in Firefox by doing the following:

  • Make a copy of places.sqlite, found in the Firefox/Mozilla profile directory
  • Using any standard SQLite tool (for example, DB Browser for SQLite), run the query:
    select url from moz_places;
  • Export the results to CSV
  • Now you can do interesting things to the exported CSV file, such as:
  1. find all occurrences of
    cat moz_places.csv |sort |uniq  |grep -i
  2. see how many unique URLs you visited at Google:
    cat moz_places.csv |sort |uniq |grep -i |wc -l
  3. extract unique URLs from any random text:
    cat * | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | sort -u

Another use case:

Find all occurrences of URLs from specific domains in browsing history and email. This can be done by concatenating the Firefox URL dump with your email archives, then grepping and sorting to find the URLs of interest:
cat /mbox+ff_dumps_folder/* |grep -i |sort |uniq

(Yes, I like using cat like this, even though it’s a bit redundant.)

Found this post insightful, funny, or useful? Consider supporting us.

Support Us