Posts Tagged ‘greasemonkey’
Bugzilla has a rarely used feature called quips. It just displays random quotes on the top of each page from a database to which clever new sentences can be added incredibly easily. Here at BalaBit we love this feature: it contains ~400 entries from the last 5-6 years and serves as a collective memory of the company, saving notable adages from colleagues often no longer working here and unknown by freshmen and which were said during the development of ancient pre-alpha versions of our now mature products. Some of the phrases from the more popular quips have became a part of the everyday spoken language we use here, hell, it’s even mentioned in the checklist made for HR used to get newcomers started on their first day under the “Company culture” section.
Well, the problem is that over the last year we’ve slowly became oh-so-agile and moved our day-to-day work tracking interaction from Bugzilla to VersionOne. We’re still using Bugzilla for its original goal (that is, tracking bugs), but most of the developers now only check it once or twice a week while they’re supposed to log their work into VersionOne and check for new tasks there every day. So the time-honored tradition of Bugzilla quips slowly started to fade, and of course, we couldn’t let it happen!
VersionOne is a proprietary application, so we couldn’t just modify it to add the quips, even though it would’ve been a fun practice to hack some ASP.NET. It does support user-made plugins, but the API for it seemed too complicated for this simple task and it does not seem to support changing the core interface, only to add new pages — but to re-add the original Quip Experience we needed a small field added on the top of the normally used listings. For a while, we experimented with the idea of using some stored XSS virus to change the interface (strictly only theoretically, of course, but just let me mention it for the record: it worked flawlessly), but that would’ve raised some eyebrows, so we had to figure out something else.
And here comes GreaseMonkey into the picture, which was made just for that: modifying the interface of a website on the client side. It took only a couple of minutes to hack together a user-side JS that added the field that is populated from the original Bugzilla database through AJAX. Only one addition was needed: Bugzilla did not have an API to query its quip database, so we had to do some easy copy-paste development to add a CGI that, when loaded by the JS, simply displays a random quote. And now we can read the classic once again: “Oh, that’s not a leak. It’s just caching.”
In the unlikely case you’ll ever need it, here’s the GreaseMonkey script (or here’s a bit more obtrusive, but more visible version) and the small CGI needed. Of course you’ll have to tailor them to include your Bugzilla and VersionOne URL’s, but otherwise, they’re ready to use. (Credit goes to Péter Györkő and Gergely Czilly for the GreaseMonkey scripts.)