Programmatically access browser history
Question
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?"
Solution
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.
OTHER TIPS
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)
The Firefox SQLite Manager Addon is a great tool. If you wish to learn about the Firefox Places design and DB schema visit Mozilla Places.