Saturday, February 4, 2012

Slaying a Zombie Browser Extension

I just finished a marathon session (on Linux Mint Katya) trying to uninstall Stylish, a zombie extension for the Firefox web browser. I have nothing against Stylish, and I don't think it was the culprit in this story, but I'm recording my methods here both to preserve them for myself and in case anyone else is locked in this battle.

Somewhere along the line, I must have installed a version of Stylish, although I don't recall when or why.  As Firefox went to its current whirlwind upgrade cycle, the installed version of Stylish (1.0.7) became incompatible.  With each upgrade, I would instruct Firefox to look for a compatible version, and it would either report failure or find one, attempt to install it, and report that the upgrade attempt had failed (with no explanation why).  Either way, the browser would open with Stylish 1.0.7 installed and disabled.

This dance got boring after a while, and I could not think of a reason for keeping Stylish, so when Firefox upgraded itself to version 10.0 today I decided to uninstall Stylish ... which is when I discovered it was now a zombie.  If you know anything about zombies, you know that they are difficult to kill.  The instructions for uninstalling an extension are simple: open the extensions tab, find the one you no longer want, and click the uninstall link ... if there is an uninstall link ... and with Stylish, there was not.  Further searching revealed the helpful suggestion that one boot Firefox in safe mode and then click the previously disabled uninstall link ... except there was no uninstall link, disabled or otherwise (nor did one magically appear when I switched to safe mode).

One can invoke Help > Troubleshooting Information in Firefox and find the file or directory name of the extension, then track the file or directory down in the Firefox extensions folder and nuke it manually.  I was able to find the folder name this way (a hex string inside braces), but no folder or file of that name existed in my profile's extensions folder.  This may mean it is installed globally, and sure enough, I found a folder of the correct name in /opt/firefox/extensions.  I nuked it (as root) and restarted Firefox.  The zombie still lived (still listed as disabled).

Upon further searching, I found an SQLite database belonging to Stylish:  /opt/firefox/defaults/profile/stylish.sqlite.  I nuked it (as root) and restarted Firefox.  The zombie persisted.

Well, perhaps I was overthinking this.  With Firefox in safe mode, I installed the latest version of Stylish (1.2.5), then restarted Firefox.  Although Firefox had failed to do the upgrade on its own, this worked.  The new version was installed and not disabled ... which meant it had a functioning uninstall link ... and there was no mention of version 1.0.7.  So I clicked the uninstall link.  After restarting Firefox, I found that Stylish 1.2.5 had successfully uninstalled ... and the 1.0.7 zombie had reappeared.

So I closed Firefox and opened the extensions.sqlite database (in my Firefox profile folder) using the SQLite database browser.  Here I was able to find an entry for Stylish 1.0.7.  It pointed to a directory (with the same hex string name as the one I'd nuked from /opt/firefox/extensions), this time located in /usr/lib/firefox-10.0/extensions.  Nothing I'd turned up in any of my Google searches pointed to /usr/lib (other than perhaps references to "globally installed" extensions, with no indication of where that would be -- hence my earlier search of /opt/firefox).  I deleted the newly found subdirectory (as root), restarted Firefox, and woo-hoo!  No sign of the zombie.