views:

1893

answers:

2

I have my web browsers set to save what I type into text boxes on forms. I have a lot of search terms stored in the text box of my browser and would like to get at it via a program of some sort before I clear these values out. There are far too many for me to go through one at a time.

The web browser must store this data somewhere, does anyone know where? Is it possible to retrieve these values? Firefox, more so than IE -- but either, if anyone knows a script that can extract these values? Thanks.

+1  A: 

Firefox 3

In Firefox on Windows it's stored in a SQLite file, in:

C:\Documents and Settings\<Username>\Application Data
    \Mozilla\Firefox\Profiles\<UID>.default\formhistory.sqlite

Once you have the SQLite file, you can put together a script to read the data from it pretty quickly - here's a good primer to using SQLite with PHP 5 for example.

Firefox pre-version 3

Apparently SQLite has only been used for the saved form history since version 3. Version 2 still uses formhistory.dat, which is written using Mork).

From the wiki on Mork:

Also, despite being plain text, Mork is generally regarded as unintelligible to humans and as a hard format to write parsers for.

There has been an item files on Bugzilla asking for a more sane and readable format to be introduced, the filer even attempted to write a perl parser for his .dat files, with limited success.

ConroyP
I dont have a formhistory.sqlite file. ALL I have is a formhistory.dat file. I searched the entire drive for that.. Got other .sqlite files but nothing that would indicate its form history. I am on FF 2.0.0.15
Optimal Solutions
My bad, it would appear that sqlite is built in from 3 onwards. What's in your formhistory.dat file? That should be the same thing.
ConroyP
Thank you so much. I will investigate this.
Optimal Solutions
Best of luck with it! On a couple of the FF pre-3 links above, various people have mentioned upgrading to 3 auto-converted their .dats to sqlite, so might be worth a try. But definitely back up your profile dir first, just incase!
ConroyP
Thats part of why I asked... my installation is hosed and I have decided to install clean and fresh - everything. I will probably go to FF3 but not via an upgrade. I had wanted to capture what I had typed into one particular search box. Ugh. Seems harder than necessary with FF2.
Optimal Solutions
A: 

It seems that you can find the form history in the form of a sqlite database under USER_DIR/Mozilla/Firefox/Profiles//formhistory.sqlite

I didn't try to browse it with sqlite but the filename seems to be explicit.

You can find several wrappers on the sqlite website to access it from the language of your choice.

Good Luck

Valentin Jacquemin