1

I want to achieve this :

  1. host an addon on my own website
  2. when user clicks a specific button on my site , addon should install automatically just like it does from Mozilla AMO
GILL
  • 319
  • 4
  • 15

1 Answers1

2

You should make sure that your web server serves the XPI file with application/x-xpinstall MIME type - then you can simply link to it and Firefox will offer to install it. To make this more fancy you can use InstallTrigger - this lets you specify things like the name or the icon of the add-on. The user will always have to allow installation request first before he sees the installation window - this request isn't displayed only for web sites on the whitelist meaning AMO pretty much for all users.

Wladimir Palant
  • 56,865
  • 12
  • 98
  • 126
  • How to make my webserver serve application/x-xpinstall ? – GILL Mar 02 '12 at 07:34
  • @GILL: Depends on the web server obviously. If it is Apache then you [use `AddType`](http://httpd.apache.org/docs/2.4/mod/mod_mime.html#addtype) in an `.htaccess` file: `AddType application/x-xpinstall .xpi` – Wladimir Palant Mar 02 '12 at 08:37
  • I achieved the above by doing this on Godaddy Linux hosting 1. created a .htaccess file using notepad++. 2. added this line into this file: AddType application/x-xpinstall .xpi 3. loaded this file into root directory of my domain using Filezilla 4. Reloaded my website in Firefox and the download link of addon now triggers direct installation on Firefox (previosly it used to open a download dialogue box). – GILL Mar 02 '12 at 10:40
  • Hi GILL, Wladimir, I have the same problem, it just doesn't recognize my .xpi file types. I have a shared hosting on godaddy. Does it matter? Also, would you know if the process would be same if it's a Windows hosting? – Piyush Soni Feb 04 '14 at 02:55