Search code examples
firefox-addonauto-updatefirefox-addon-sdk

How do I code my Add-on so that Firefox knows where to check for updates?


I am developing an Add-on and I am having trouble finding documentation that explains how to let Firefox know where to look for updates. If I post an .xpi on my website and the user downloads and installs that .xpi, does Firefox know to check that URL for changes? or do I have to put something in package.json?


Solution

  • Are you using the online builder or the SDK command-line tool? You can only specify the update url using the cfx tool:

    https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/cfx

    When building your add-on, you would run cfx xpi with the following arguments:

    cfx xpi --update-link https://example.com/addon/latest
              --update-url https://example.com/addon/update_rdf
    

    If you have already built your add-on using builder, a hackier option would be to download the xpi, unzip it, manually edit install.rdf and then re-zip it. See MDN for documentation on install.rdf syntax:

    https://developer.mozilla.org/en/Install_Manifests