Tibs Manor

Thursday, December 01, 2005

Cookie Crumbler

The other day, Kimmel requested that I write a Firefox extension that actually already existed. However, I thought of another task I would love to automate via an extension. Firefox is nice in that it comes with a decent cookie manager - you can see all cookies on your machine, delete only the ones from a certain domain, or even just one particular cookie. However it's buried several menus deep, and most people have hundreds of cookies on their machine so scrolling takes time, even in the improved Cookie Manager interface found in Firefox 1.5. When your job entails repeated testing of things that set and modify cookies, you find yourself clearing certain cookies again and again, even though it only takes about 10 seconds to do, when you are doing it 50 times a day it wears a little thin. The slightly faster alternative is to clear ALL cookies, and who wants that? I hate logging into all my favorite sites again. Nuts to that.


Enter Firefox extensions. I'm writing one now that I call "Cookie Crumbler." It sits in the status bar of your browser and gives you a button you can hit to crumble your cookies. Right now it is hardcoded to delete all cookies from ".go.com" and that portion of it is working. I'm going to add a way to specify other domains as you like, specify only certain cookie names rather than all cookies within a domain, etc. It's already in usable form and a nice little timesaver for me, and once I have it polished up a bit I'll submit it to the general Firefox extension repository.


This is a learning project for me, my only previous Firefox tweaking has been adding a new engine to the search interface. Extensions seem to mainly be written in a combination of XML and JavaScript. You use XUL (XML User Interface Language) to define stuff like buttons, menu items, dialog boxes, windows, etc. that integrate with the existing Firefox user interface (which is itself fully written in XUL). The elements here can be tied to fire JavaScript functions, which can then do the actual work (in this case, looking at and deleting the cookies). Pretty painless and interesting stuff actually. I've found a few tutorials here and here. This thing has a sense of humor too, the namespace you define as a default is "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - pronounced Zuul of course.

0 Comments:

Post a Comment

<< Home