Distributing an add-on yourself

You aren't required to list or distribute your add-on through addons.mozilla.org (AMO); you can distribute it yourself. However, before distributing your add-on yourself, here are some things you should consider:

  • AMO is a very popular distribution platform with millions of monthly visitors and installations. It's integrated into the Firefox Add-ons Manager, allowing for easy installation of add-ons published on AMO.

  • When an add-on is listed on AMO, Firefox automatically updates installed copies when a new version is listed on AMO. Firefox updates self-distributed add-ons like this:

    • If the extension includes an update_url in its manifest, Firefox installs any updates with a higher version number available on that URL.
    • If it doesn't include an update_url, Firefox checks AMO for a listed update. If a listed update with a higher version number is available, Firefox distributes that version to users who have installed the self-distributed file.

    Otherwise, you need to distribute updates for your users to install.

For more information on how to submit an add-on for distribution on AMO or self-distribution, see Submitting an add-on.

Self-distribution options

When you choose to distribute an add-on yourself, users can install them using these methods:

  • Web download in Firefox for desktop—make your extension available on a suitable web-accessible server. When a user downloads the signed add-on file, Firefox installs it. The web-accessible server must serve the signed add-on xpi file with Content-Type: application/x-xpinstall in the HTTP response headers.

    This method doesn't work in Firefox for Android. In this case, the add-on is downloaded, and the user needs to follow the instructions for installing add-on from file.

  • Installing add-on from file—enables a user to install an add-on using an .xpi file saved on their computer or Android device.

  • Add-ons in an enterprise environment—this page discusses the use of signed compared to unsigned extensions, installation options, the Firefox settings affecting installation, and including add-ons with a custom Firefox install package.

Web download

When distributing an add–on from your website, you have two options for making the signed add–on file available for download:

  • Recommended approach: from a link on a webpage, like this:

    <div id="example-option-1" class="install-ok">
      <a href="https://example.com/path/to/extension.xpi">
        Install my add-on
      </a>
    </div>
  • Using JavaScript, like this:

    <div id="example-option-2" class="install-ok">
      <button>
        Install my add-on
      </button>
      <script>
        document.querySelector("#example-option-2 > button").onclick = () => {
          window.location = "https://example.com/path/to/extension.xpi";
        };
      </script>
    </div>

    If you take this approach, make sure that the browser detects your JavaScript code as handling user input. For example, it is called from inside a DOM click event.

If the download link or triggering JavaScript is not on the top-level frame of the website, none of the frames between the top-level page and the frame containing the download or JavaScript can be third-party or cross-origin frames.

You may find references to using the InstallTrigger API to trigger a download from JavaScript. This API is not supported and it will be removed (see Bug 1776426). Its use is, therefore, not recommended.

Using either method, Firefox installs the signed add-on file when the user downloads it.

See submitting an add-on for details on how to download your signed add-on file.