Setting Up Extensions to Install

If your an extension developer and trying to distribute addons from you own site, you may find that you are prompted to download them instead of installing them. This is how to fix it.

# Force Extensions and Themes to Open the Install Window
AddType application/x-xpinstall .xpi .jar

This will tell Apache (the web server most site use) to send a http header with all .xpi files that says it is of type application/x-xpinstall. Which in turn tells Firefox that this in an extension. Web browsers, contrary to what some may expect, don't look at file extensions to find out what type of file it is dealing with.

Having done this you may find another problem, if you want to provide extension to Thunderbird they will open the install window to. Here is my solution.

# Force Links to Extensions that end in ?download=true to open the download window.
RewriteEngine on
RewriteCond %{REQUEST_URI} download=true$
RewriteRule \.(xpi|jar) - [T=application/octet-stream,L]

Now you can provide links for both Firefox and Thunderbird without problems.