Skip Site Navigation «

DRX/installed

app«drx

Installed Extensions

The proof is in the pudding as they say, and the purpose of this page is to list all the Firefox Extensions I have installed on one of my client-side development machines—thanks to Nickolay Ponomarev’s InfoLister.

How am I able to do this? Among some other interesting features, InfoLister allows me to automatically upload an XML snapshot of the information it collects to this host. The XML file contains some browser metadata, a list of the installed plugins, themes and (what I’m after) every installed extension. These are stored as a set of <ext> element nodes, containing attributes for the homepage URI, version number, author and a description of the extension. Firefox maintains this list internally, and the details are provided by each extension author as part of their RDF Install Manifest.

How does InfoLister do this? Well, the code is written in JavaScript (as you would expect) and one function, gAddonsProvider(), collects all the XPI extensions and themes, which are then stored in separate arrays. This process is fairly complicated, but this is open-source software so why not dig in there and figure it out if you’re interested? Depending on your option settings, InfoLister will produce plain text, HTML, XML, and so on.

Once you have the XML data on your server, then what? Well, I suppose it depends on what you plan on doing with it. I wanted to stick to my guns and convert it to an XHTML unordered list and use my existing markup and CSS. One approach might be to use an XSLT stylesheet to transform the XML to XHTML. If I was maintaining a collection of these Firefox profiles I would consider generating the results by opening a JavaScript XMLHttpRequest connection to fetch the XML data, and then dynamically update the DOM.

I opted to use PHP to parse the XML, extract the extension data, and build an array of <li> elements. If you’re running PHP 5, then I highly recommend using SimpleXML for such tasks. As I am currently using PHP 5.2.5 on this box, I decided to use Keith Devens’ XML Library, which expects a stream of XML data (use file_get_contents() to read the file first) and then “unserializes” the data into a PHP nested array. Keith provides a translator so you can see this process in action. Here is my original XML, and the resulting PHP.

Note: As you can see, I have upgraded to PHP 5.2.5. Why am I still using XML Library over SimpleXML? Well, for one I am somewhat shocked the old code still functions, and of course the other reason is shear laziness. But I really should refactor my implementation to use the native SimpleXML extension.

Once you have your PHP data structure, creating the list is as simple as looping through the $ext array, pulling out the name, URI, author and description metadata, and building the unordered list as you go. I’m using this function to build the list below. Note that the $ext array consists of element pairs, each integer index into the array holds the name of the extension and the associated (string) index (array offset + ' attr') is another array that holds the metadata (attributes) for that extension. Also notice I am skipping disabled extensions.

As you can see, the code returns a few other morsels. So if you’re curious about my browser version and platform information, I’m even willing to cough up the User Agent string:

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3

And some other tidbits:

The XML data was last uploaded on Tuesday, November 4th, 2008 @ 5:58 AM EST.

I have 19 enabled extensions installed.

What else could you do with this data? How about an RSS feed that returns your installed extensions? Not a bad idea, I’m constantly testing out new ones and removing others I no longer use.

If you have questions or comments, you can visit my my blog post on this topic.

So why not share your Firefox extension list? Here’s mine.

toetag developer extension firefox javascript mozilla php rdf rss web xhtml xml xslt xul  

My Firefox Extension List

Indexes

§ A.Author
§ B.Best
§ D.Domain
§ F.Recent
§ G.Tag
§ H.Title

Last updated: Sunday, November 30th, 2008 @ 12:59 AM EST [2008-11-30T05:59:06Z]   home

(c) 2008-2010, Douglas W. Clifton, loadaveragezero.com, all rights reserved.