3

This is the first time I am trying to self host a mozilla addon (or web extension). I have already generated signed xpi file using web-ext tool. Can someone please share the next steps to host the web extension so that users can directly install web extension from my site ?

Even a documentation link will be really helpful.

Here is an example of hosted singed xpi file

https://dl.dropboxusercontent.com/u/71743966/requestly/firefox/requestly-4.1.6-an%2Bfx.xpi2

When I open this link in Firefox, it says

Firefox prevented this site from asking you to install this software.

How can I fix this problem ? I even asked this question on Mozilla discourse but no luck.

Here is my manifest.json

{
  "name": "Requestly",

  "version": "4.1.6",
  "manifest_version": 2,
  "description": "Mozilla Firefox addon to modify HTTP requests (Redirect | Cancel | Replace | Modify Headers)",

  "updateURL": "https://dl.dropboxusercontent.com/u/71743966/requestly/firefox/update_manifest",

  "updateLink": "https://dl.dropboxusercontent.com/u/71743966/requestly/firefox/requestly-4.1.6.xpi",

  "content_scripts": [
    {
      "matches": [ "*://web.requestly.in/*" ],
      "css": [ "src/pages/generated/css/main.css" ],
      "js": [ "src/pages/generated/js/libs.js", "src/pages/generated/js/main.js" ]
    }
  ],

  "background": {
    "scripts": [
      "browser_config.js",
      "src/background/storageService.js",
      "src/Shared/shared.js",
      "src/Shared/utils.js",
      "src/background/background.js"
    ]
  },

  "browser_action": {
    "default_icon": "resources/images/128x128.png",
    "default_title": "Modify HTTP/HTTPS requests"
  },

  "icons": {
    "16": "resources/images/19x19.png",
    "128": "resources/images/128x128.png"
  },

  "permissions": [
    "contextMenus",
    "storage",
    "webRequest",
    "webRequestBlocking",
    "tabs",
    "http://*/*",
    "https://*/*"
  ]
}
Sachin Jain
  • 21,353
  • 33
  • 103
  • 168

1 Answers1

2

You need to create an HTML page and installation can only be triggered with user's manual click. Opening the link of xpi file directly does not allow users to install the addon.

So I created a simple HTML page like this:

<html>
    <head></head>
    <body>
        <center>Install Requestly on Firefox</center>
        <a href="https://dl.dropboxusercontent.com/u/71743966/requestly/firefox/requestly-4.1.6-an%2Bfx.xpi"> Click here on download </a>
    </body>
</html>

After hosting this page and clicking on download link actually installed the addon in Firefox v49.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
Sachin Jain
  • 21,353
  • 33
  • 103
  • 168
  • Does this really work for you? http://plnkr.co/edit/Bzb9QOpZsAUiM5dthap0?p=preview fails for me – bmm6o Jan 18 '17 at 00:44
  • Yes this approach still works for me. You can checkout at htyp://requestly.in. Click on firefox button in Firefox browser. – Sachin Jain Jan 22 '17 at 16:16
  • @bmm6o: I'm guessing you need to host the .xpi with https. In your plunker you're using http – LOAS Apr 10 '19 at 08:47