Self-contained Firefox search plugins

·

Even that last template for Movable Type wasn't enough to make search plugins a pleasant experience.

There are three obstacles to overcome: 1) is to generate the source file, which a template can handle; 2) is to put the source file and an image file on a server somewhere and 3) is to generate a javascript link to install the plugin.

A search plugin can't use an actual favicon.ico file as the image - for some reason it has to be a PNG or GIF of the same size. The favicon-to-png converter on my server helps with that: feed it a favicon URL and it will generate a PNG.

For the other parts, this is my solution so far: first make sure the plugin source is well-formed XML, then use a simple XSL stylesheet to display the source file with a clickable 'Install' link. A problem here is that Apache has to be configured to serve .src files as application/xml, otherwise they don't get converted and displayed: one way to hack around that is to use 'file.xml' but give the address 'file.xml?/file.src', which fools the search plugin installer enough that it uses 'file.src' as the filename.

Here's an example styled plugin. The XSL and CSS files are linked from the source.