Nikolay Dyankov
Nikolay Dyankov

Reputation: 7244

Install Firefox Addon from a link, instead of downloading the .xpi

I just made a FF addon and made a simple website. I'd like when a visitor clicks the "download" button the addon to install, instead of getting downloaded. It works locally, but not when I upload the site. I checked the mozilla repository, they just link to the xpi file as well.

What am I doing wrong?

Upvotes: 6

Views: 3089

Answers (1)

Jonah Bishop
Jonah Bishop

Reputation: 12601

The problem is that you haven't registered the XPI MIME type for your website. You can do this by adding the following rule to your site's .htaccess file (assuming your site uses an Apache server):

AddType application/x-xpinstall .xpi

This should result in what you want (a user clicks the link and is prompted to install the XPI file).

Fore More Reference https://developer.mozilla.org/en-US/Add-ons/Extension_Packaging#Making_an_extension_XPI

Upvotes: 10

Related Questions