Catching the Acts – Firefox Extension Development
Posted on August 20th, 2007 by Phil
For a presentation at the workshop Web 2.0 and Social Software in Technology enhanced Learning at the DelFI 2007 I am currently knocking up a Firefox Extension, that aims at
- recognizing a search act (e.g. via Google)
- recognizing a bookmarking act and
- displaying the ratio between the number of aforementioned acts.
Should be straightforward, shouldn’t it? But noooo, there have been a few problems up to now. Firefox development is not a really easy task, current documentation is sparse, and debugging and building the extension can be a pain. Especially as there are so many ways to do things, it is hard to see the “right way”. As for the problems:
- Recognizing Search Acts: Actually this seems to be the easiest part: registering a listener at the
onload-Event of theappcontent-Element should do the trick. As this part should be as extendable as possible, I plan a central Singleton, where other code may subscribe to this listener handing over a URL pattern (e.g. a regular expression). The Event is forwarded to the other code only if the pattern matches the called URL. - Recognizing a Bookmarking Act: Difficult, difficult. I have a general idea how to do this, but as there are different ways of bookmarking (Ctrl+D vs. Drag’n'Drop) there doesn’t seem to be a central Observable that could be observed (at least in Firefox 2.x). The much-anticipated Places in Firefox 3 may solve this finally… My post in mozilla.dev.ext didn’t get any answers to this questions up to now, so either it is pretty easy or pretty difficult. Anyone any ideas?
- Displaying. There are so many ways of doing this I am just overwhelmed with possibilities… The 1M$-question is which one to decide on. We’ll see…
Apart from that my colleague Doreen (no blog yet!) and I try to bend our minds around communicating between JavaScript (Firefox) and Java. But that is a sad story for itself…
Discussion Area - Leave a Comment