How To Fix Broken about:home Search In Firefox

Not that I recommend it, well actually I have, and do for “advanced” users (I will update that at some point), but occasionally cleaning out your Firefox profile can be a good thing. Every so often I clean the cruft out of mine. Here’s a little quirk however. The new-ish browser start page won’t perform a search when localStorage is cleaned out. It will manifest by simply doing nothing when you try to search. The form goes nowhere. If you look for errors in the console you’ll see:

"gSearchEngine is null"

The best solution I’ve found to fixing this is to go into about:config and reset (right click -> reset) these properties and restart:

browser.startup.homepage_override.buildID
browser.startup.homepage_override.mstone

I suspect it’s just buildID, however neither should be harmful. Restart and they will be recreated.

Cleaning a Firefox Profile

I occasionally like to clean my Firefox profile. I test quite a few extensions, and play around a bit, so every once in a while, I just want to clean up. This method has worked rather well for me over the years. Essentially I imported my Netscape 4 profile into Netscape 7, then Mozilla App Suite, then split into Firefox and Thunderbird, so essentially I have data in there that’s several years old. I thought I’d share what I do, and why I do it, in hopes that perhaps someone else would benefit.

These directions were drafted with Firefox 1.5 as a reference point, for older or newer releases the directions may not work (for example if you use a Firefox build with “Places”).

A word of advice:

For the record, this is at your own risk, back up before you touch anything. Backup by copying The Firefox directory as mentioned in respective location below (a directory above Profiles). You’ve been warned.

Directions

You may want to start out by going to the Bookmarks menu and selecting “Manage Bookmarks”. Then cleaning out and organizing your bookmarks, if you want to keep them in your new profile. It’s a good habit to get into.

The first real step I do is visit my profiles directory:

Windows

C:\\Documents and Settings\\[Windows Username]\\Application Data\\Mozilla\\Firefox\\Profiles\\

Mac OS X

~/Library/Application Support/Firefox/Profiles/xxxxxxxx.default/

Your profile will be a directory with a salted name. Something like xxxxxxxx.default. Those x’s are random characters.

Because I only have 1 real profile (and one for dev purposes of which I choose to preserve nothing), I like to rename mine to something else. As far as I’m concerned this one is dead to me. I’m going to also get rid of the profiles.cfg and pluginreg.dat files in the Firefox Folder (up above profiles), then run Firefox and create a new profile on prompt. If you have multiple profiles you wish to leave untouched you would be better off using firefox.exe -profilemanager in the command prompt and simply creating a new profile.

Ok, so now we have this really clean new profile, and that old crusty one with lots of junk. Well, I want some of my stuff in my new clean profile, but only certain things. So here’s a breakdown of what I do, pick and choose as you want. Obviously the less you bring over, the better.

Only perform the following when Firefox is not running.

Bookmarks
Simply copy the bookmarks.html file from the old profile into the new profile.

Cookies (stay logged in with all your sites)
I like to carry these over, since I like being logged into certain sites (forums and such). Just copy the cookies.txt file from the old profile into the new profile. If you open the file up in a text editor you can delete a line or two (get rid of those old cookies, or just to satisfy that tin-foil-hat feeling). Just be careful if you do.

Password
I also like to keep my stored passwords (nothing important, just those news sites, and other silliness that I don’t feel like entering each and every time). Password Manager is great for that. The files you want to copy over are: cert8.db, secmod.db, key3.db, signons.txt.

Extensions
My recommendation on Extensions is to visit addons.mozilla.org (Google for the ones you can’t find) and re-download. The reason I prefer to do that rather than move them over, is because some just seem to stubborn to use the update service, and that leaves me with some old extensions. Also, in this process I typically realize there are one or two that sounded like great ideas, but I just never really used them. Less extensions means less chances for a memory leak. That’s always a good thing.

Search
Just copy the search.rdf file and searchplugins directory over.

Final Notes

This process typically takes me about 5-10 minutes (mainly depending on if I cleanup my bookmarks and cookies). Overall not bad. Gets rid of the crud that tends to accumulate over time, and keeps things pretty lean. This is also pretty useful if you encounter some profile corruption or other ugliness, especially if your one of us trusting soles who occasionally run nightlies from the trunk.

If you do it all correctly, you get a nice clean profile, but still keep your important data. Cache and autocomplete list will rebuild pretty quickly as you use the profile. I’ve found this technique is great for reviving that profile that’s just littered with garbage from various things I’ve done, and extensions I’ve tried.

Hopefully this helps someone.