Skip to the content...

Welcome to the David Walsh Blog. I'm a MooTools, Dojo, jQuery, CSS, and PHP Web Developer located in Madison, Wisconsin, United States. Please contact me if I can make your experience on my website better.

Adding the XPI MIME Type for Firefox Extension Installs

5 Responses »

Yesterday I posted version 0.1 of the David Walsh Blog Toolbar for Firefox. Unfortunately that led to an awkward conversation with my .htaccess file.

.htaccess: I have no idea what to do with this.
me: I want the toolbar to install when they request this file.
.htaccess: Well, how am I supposed to do that?
me: OMG! You don't know?!
.htaccess: No, just like you didn't know how to create a Firefox extension before you did the research.
me: Good point. When can you research and start serving it up?
.htaccess: I can't research. I'm a file.
me: Oh. So I just need to figure things out for you again?
.htaccess: You never pay attention to me anymore...

That went on for quite a while but the moral of the story is that if you want your server to handle XPI files correctly, you need to add the following to your .htaccess file:

AddType application/x-xpinstall .xpi

If you don't add the above directive, Firefox will open the file as plain text which is an ugly mess.

Discussion

  1. May 12, 2009 @ 8:42 am

    Only a web dev could have some kind of decent conversation with a file!

    I did wonder why it didn’t install when I clicked it, good to see you found out why though. The ever brilliant David saves the day!

  2. May 12, 2009 @ 9:37 am

    Awesome :)

    Is it just me or are .htaccess files getting increasingly uppity lately?

  3. May 12, 2009 @ 9:55 am

    You’re hilarious, dude! Have fun in Cali!!

  4. facundo
    May 13, 2009 @ 4:46 am

    LOL! i used to have long talks whit .htaccess too.

  5. May 18, 2009 @ 8:03 am

    I envy your relationship with your .htaccess file.

Be Heard!

Share your thoughts with fellow developers of all skill levels! I want to hear from you!

Name*:
Email*:
Website:  
Wrap your code with <code> tags, f00!