Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically access browser history

Tags:

sqlite

firefox

how can i create an application to read all my browser (firefox) history? i noticed that i have in

C:\Users\user.name\AppData\Local\Mozilla\Firefox\Profiles\646vwtnu.default

what looks like a sqlite database (urlclassifier3.sqlite) but i don't know if its really what is used to store de history information. i searched for examples on how to do this but didn't find anything.

ps: although the title is similar i believe this question is not the same as "How do you access browser history?"

like image 943
Vitor Silva Avatar asked Jan 25 '23 03:01

Vitor Silva


2 Answers

I believe places.sqlite is the one you should be looking into for history (Firefox 3). Below are a couple of Mozilla wiki entries that have some info on the subject.

  • Mozilla 2: Unified Storage
  • Browser History (see especially section "Database Design" here)

In earlier versions of Firefox they stored history in a file called history.dat, which was encoded in a format called "Mork". This perl script by Jamie Zawinski can be used to parse Mork files.

like image 55
hasseg Avatar answered Jan 30 '23 05:01

hasseg


I also found the following links to be interesting:

  • Literally make history with Firefox 3
  • SQLite on .NET - Get up and running in 3 minutes.
  • SQLite Manager Firefox Addon

After adding a reference to System.Data.Sqlite in my .Net project, all I had to do to create a connection was:

cnn = New SQLiteConnection("data source=c:\Users\user.name\AppData\Roaming\Mozilla\Firefox\Profiles\646vwtnu.default\places.sqlite")
cnn.Open()

I had one minor glitch has the .net sqlite provider does not support sqlite3_enable_shared_cache which I believe is preventing me to open the places.sqlite database while having firefox running (see Support for sqlite3_enable_shared_cache)

like image 41
Vitor Silva Avatar answered Jan 30 '23 05:01

Vitor Silva