mozilla
Your Search Results

    Hotfix Extension

    The hotfix extension is a special add-on that can be used to deliver restartless over-the-air fixes to desktop Firefox users. It is created just like a normal restartless extension and published on AMO, and the Add-ons Manager will periodically check for newer versions of the hotfix.

    How to develop a new hotfix

    The code for the hotfixes is at https://hg.mozilla.org/releases/firefox-hotfixes/.

    A new hotfix will live in a top-level dir following the convention vYYYYMMDD.XX. You can start by copying one of the existing ones into a new folder. The version must be greater than the version of the previously released one. Don't forget to update the README file (in the root srcdir) to include the bug number where the hotfix was developed and a description of what it does.

    Package the hotfix by running HOTFIX=vYYYYMMDD.XX make package in the root srcdir. This instruction can also be found in the README file.

    The hotfix system can support versions of Firefox as low as Firefox 10.

    Testing the hotfix locally

    To test the hotfix locally, get the .xpi file and drag&drop it into Firefox's window.

    Things to look out for:

    • Test that the hotfix does what it is expected to do, obviously.
    • Test that the hotfix uninstalls itself after completing its task. Most of the hotfixes we've shipped so far performs an immediate task and uninstalls itself right afterwards, but there were some exceptions where it needs to remain installed until certain conditions are met.
    • Test the extension with the oldest Firefox version that it supports (minVersion), to make sure the code in the hotfix does not use any API or JS syntax that was introduced only on later versions.
    • Test on all target OSes.
    • Disable the strict compatibility checking and install the hotfix on an unsupported version to test that it does not perform its task, as expected. (The hotfix has code to check that it only runs on its target versions even with strictCompatiblity off).

    Testing the hotfix on the staging server

    To test the hotfix on the staging server, get it signed and uploaded to addons-dev.mozilla.org. After that is done, do the following steps in a clean Firefox profile:

    If testing on a Firefox version earlier than 24, make sure you have the right signature fingerprint configured. See the Signatures session for more details.

    • Check if extensions.hotfix.id is set to firefox-hotfix@mozilla.org (it should be the default).
    • Set extensions.logging.enabled to true. This will log messages from the Add-ons Manager to the Console, and to stdout if in a debug build.
    • Set extensions.update.interval to 10.
    • In the pref extensions.update.background.url (extensions.update.url for Firefox < 13), change the versioncheck.addons.mozilla.org part from the string with addons-dev.allizom.org.
    • Restart Firefox and open the Add-ons Manager and the Console. Wait a while for the Add-ons Manager to check for updates (messages about it should show in the Console).
      • Note that there might be other pending update checks that will run before, for example an update check for the "default theme" add-on, with id={972ce4c6-7e08-4474-a285-3208198ce6fd}.
      • If the hotfix is not being downloaded, get the URL from the logs and check that the RDF returned at that URL contains information about the hotfix. To make this easier, see the update check section.
      • After a successful update check is performed, the hotfix should be downloaded and installed.
    • Check that the hotfix performed its action correctly.
    • Check that the pref extensions.hotfix.lastVersion was set to the correct version name of the hotfix being tested.
    • Check that the hotfix was not downloaded and installed to incompatible Firefox versions.
    • Check that it uninstalled itself after completing its task. If you have the Add-ons Manager tab open, you might need to close and re-open it for the hotfix to disappear.

    Signatures

    The hotfix extension is signed and the Add-ons Manager will only install it if it matches a pinned signature, stored in the extensions.hotfix.certs.1.sha1Fingerprint pref.

    The signature has changed over time (in Firefox 16.0.2 and Firefox 24), and users with current installations were updated to the newer signatures through a hotfix itself (bug 803596 and bug 874513).

    This means that a clean profile from Firefox 10 - 23 won't have the right signature from start, and it needs to be updated to proceed with the testing. The current correct value for the pref is 91:53:98:0C:C1:86:DF:47:8F:35:22:9E:11:C9:A7:31:04:49:A1:AA

    Triggering the update check

    To not wait on the update interval and manually trigger the update check, you can run the following code snippet. Please only do this when debugging things or when there's plenty of evidence that the timer update trigger is working properly.

    var obj = {};
    Cu.import("resource://gre/modules/AddonManager.jsm", obj);
    obj.AddonManagerPrivate.backgroundUpdateCheck();

    Run this in a priviliged script context, such as the Browser Console or Scratchpad set to the Browser environment.

     

    Document Tags and Contributors

    Contributors to this page: felipc, mnoorenberghe, mathieu_agopian
    Last updated by: mnoorenberghe,
    Hide Sidebar