Cleaning up Firefox... somewhat.

08 September 2017

Chances are you're running one of two major web browsers on the desktop to read my website - Firefox or Google's Chrome.

Chrome isn't bad; I have to use it at work (it's the only browser we're allowed to have, enforced centrally).  In point of fact, I'd have switched to it a long time ago if it wasn't for one thing.  I make heavy use of a plugin for Firefox called Scrapbook Plus, which make it possible to take a full snapshot of a web page and store it locally so that it can be read offline, annotated, and full-text searched.  I never count on having connectivity (I live in the United States, after all, and right now my home connection is running quite poorly and has been for several days due to an ongoing situation at my local CO) so I try to keep both essential documentation and reading material in general stored locally for those dry periods.  However, there is no port of Scrapbook Plus for Chrome, nor is there a workable equivalent addon for same (I think I've tried them all).  I'm not about to do without my traveling hoard of information (which at this time numbers around 10,000 unique web pages and 15 gigabytes of disk space).  Out of desperation last night I did some research into how I might be able to speed up Firefox just a little and get more use out of it until I figure out what to do.  Here's what I found:

First of all, a little bit of background.  I think I've been using the same Firefox profile - the same set of configuration databases, caches, skins, and bookmarks - on Windbringer for maybe fifteen years.  Every time Firefox gets upgraded it runs through the profile and adds new settings, tweaks old ones, and generally revamps things.  What it does not seem to do, however, is blow out any of the cruft. This is why my Firefox profile, when last I looked at it, was something like 20 gigabytes in size (including Scrapbook archives).  So I did a bit of research and stumbled across this article which had some helpful suggestions.  After experimenting with all of them and making a full system backup I decided to refresh my Firefox profile, which does the following:

  • Move your existing Firefox profile out of the way to ~/Desktop/Old Firefox Data/<your profile>.default
  • Create a brand new, mostly empty Firefox profile in ~/.mozilla/firefox/<your new profile>.default-<timestamp>
  • Copy the bare minimum of files from your old profile into the new one so you're not completely hamstrung, like your bookmarks, your password database, and your existing cookies.
  • Ignore any and all plugins you may have installed.  You'll have to reinstall them if you want them.
  • Start up a new Firefox session using your new profile.

To refresh the profile I used the procedure in the article I linked to above:

  • Type about:support in the URL bar.
  • Select Give Firefox a tune up
  • Click Refresh Firefox
  • Click Refresh Firefox again in the popup box to confirm.

I was gratified to note that the procedure backed up all of my old profile data first (that's why I made a system backup, I never assume data preservation).  I was also somewhat horrified to note that the process took about two hours on my laptop.  I suspect that this is in part due to my using one install on this hard drive for several years, meaning that the file system is pretty fragmented, and in part due to the fact that I have so many bookmarks (roughly 4,404 in the moz_bookmarks table of the places.sqlite database) (I should probably look into using a plugin to vacuum the cruft from database or possibly do it myself because it's just a SQLite database).  I should probably cull my local bookmarks because I have no idea how many are still usable; this plugin looks useful.  This also meant that the fonts went back to being teeny-tiny.  Oops.

A little more research revealed how to, it would seem, finally fix my hacky tiny-fonts problem.  I did it this way:

  • Type about:config in the URL bar.
  • Type pix into the Search bar.
  • Double click on layout.css.devPixelsPerPix and change the value from -1.0 to something else.

I did some experimenting and found that setting that value to 1.5 not only scaled web pages up sufficiently well that I could read them easily but it also blew up the sizes of the text on various parts of the web browser itself nicely, as well as increased the sizes of the icons in the menus proportionately.

On the whole, Firefox is acting much more snappily but not perfectly.  It seems to use much less CPU time than it did before (which might also be a function of my not having installed all of the plugins I had before, just a select few).  Memory utilization also seems to be down to a third of what it was before (again, it could have been the plugins I was using at the time).  I have reason to suspect that some of the older settings were hamstringing Firefox in general and the JavaScript engine in particular.

Now I just have to find a viable alternative to Scrapbook and I can move on...