permalink.gif 2004-12-12

permalink.gif Firefox application overlay: extending the radio aggregator

Sun Dec 12 13:17:40 GMT 2004  Permalink 

I've just made my first use of the userScript extension which I mentioned before. I'm still a user of the Radio Userland built in aggregator despite it having many issues which bug me. Fixing the aggregator inside Radio is a non-starter because your changes can get arbitrarily trampled and, anyway, I dislike working inside the Radio base code.

My first thought on seeing the the userScript extension was "can I write a Javascript overlay to add new controls to the aggregator?" The answer is yes:



As you can see from this screenshot I have a Javascript in place which adds a select and deselect option to the posts from each feed which controls the checkbox next to each post in the group. This script is only invoked for the Radio aggregator page. For good measure it also scrolls the first post of the next group into view.

This fits well with my reading style where I have checkboxes default to unchecked and I manually check items I know I won't read or respond to further. This is often quite a few (especially with the bug in Radio which causes Typepad and some MT feeds to repeat themselves endlessly).

Now I can quickly scan down hitting select and moving on to the next group. At the bottom of the page I can hit delete.

Given that the HTML generated by Radio is so nefarious this was a somewhat tedious task, nevertheless I now have a useful application overlay which did not require modifying the Radio code in any way. I have other ideas but they'll have to wait. If anyone else wants to try this here is how:
  1. Be using either Mozilla or Firefox browser
  2. Install the userScript extension
  3. Download my userScript.js
  4. Install it in your profiles chrome folder (mine is C:\Documents and Settings\Matt\Application Data\Mozilla\Firefox\Profiles\ypznbsa4.default\chrome)
  5. Make sure the file is called userScript.js (I renamed it to prevent conflicts)
  6. And, of course, don't blame me if anything horrible happens - you installed it!


permalink.gif Firefox debugging trick

Sun Dec 12 11:24:12 GMT 2004  Permalink 

I've often lamented the fact that you can't write to the Javascript Console.  When trying to debug scripts which use iteration you really can't use alert() because the popup nature is too intrusive and you can't break out of it (you only have to leave an alert() in a script that goes through a few hundred iterations once to learn this lesson).

This morning I was trying to figure out whether Firefox offered a way of writing to the Javascript console and I found that it does but you have to use signed scripts.  That's impractical for most uses but the authors have a useful alternative.

You can start the browser with a -console option which will give you a separate console window to accompany the browser window. From Javascript you can then use dump(str) to write statements to this window.  Very neat.