• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
Firefox
  1. MDN
  2. Mozilla
  3. Firefox
  4. Firefox developer release notes
  5. Firefox 5 for developers
  6. Updating add-ons for Firefox 5

Updating add-ons for Firefox 5

In This Article
  1. Do you need to do anything at all?
  2. User interface related changes
    1. Determining the UI language
  3. DOM changes
  4. JavaScript changes
  5. Interface changes
  6. See also

This article provides an overview of the changes you may need to make to your add-ons in order for them to work properly in Firefox 5. You can find a complete list of developer-related changes in Firefox 5 in Firefox 5 for developers.

Do you need to do anything at all?

If your add-on is distributed on addons.mozilla.org (AMO), it's been checked by an automated compatibility verification tool. Add-ons that don't use APIs that changed in Firefox 5, and have no binary components (which need to be recompiled for every major Firefox release), have automatically been updated on AMO to indicate that they work in Firefox 5.

So you should start by visiting AMO and looking to see if your add-on needs any work done at all.

Note: You should still test your add-on on Firefox 5, even if it's been automatically upgraded. There are edge cases that may not be automatically detected.

Once you've confirmed that you need to make changes, come on back to this page and read on.

User interface related changes

Due to the short development cycle (even for our rapid release cycle; Firefox 5 was on an extra-short schedule for timing reasons), there are very few UI related changes in Firefox 5.

Determining the UI language

In the past, the window.navigator.language DOM property reflected the language of Firefox's user interface. This is no longer the case; instead, it reflects the value of the Accept-Language header for the current document. If you need to detect the UI language, you should instead look at the value of the general.useragent.locale preference.

DOM changes

The behaviors of window.setTimeout() and window.setInterval() have changed; the minimum allowed time has changed, and varies depending on the situation. In addition, timeouts and intervals are clamped to one per second in inactive tabs (that is, tabs the user isn't currently looking at).

JavaScript changes

The following keywords are now reserved in JavaScript, even when you're not in strict mode:

  • class
  • enum
  • export
  • extends
  • import
  • super

Don't use those keywords anywhere in your code, even as object property names.

Note: This is one of those things that AMO's automatically upgrade tool may not always catch, so check your code for these if your add-on was automatically upgraded but is still not working properly.

Interface changes

Instantiating certain services, including the nsICertOverrideService, at startup can make Firefox unusable (bug 650858. This happens only if you try to instantiate a service before the load event is fired.

To fix this, simply move your instantiation of these services into your load event handler:

var MyObject = {
  comp : null,
  init: function() {
    this.comp = Components.classes[...].getService(...);
  },
  ...
}
window.addEventListener("load", function() { MyObject.init(); }, false);

An even better solution, of course, is to follow performance best practices and to not instantiate services until you need to use them.

See also

  • Firefox 5 for developers

Document Tags and Contributors

Tags: 
  • Add-ons
  • Extensions
  • Firefox 5
 Contributors to this page: teoli, Sheppy
 Last updated by: teoli, May 27, 2014, 3:32:11 AM
  1. Add-ons
    1. Firefox developer release notes
    2. Add-ons
    3. Add-on guidelines
    4. Add-on Manager
    5. Extensions
    6. OpenSearch plug-ins
    7. Plugins
    8. Themes
  2. Firefox internals
    1. Firefox developer release notes
    2. Mozilla project
    3. Gecko
    4. JavaScript code modules
    5. JS-ctypes
    6. MathML project
    7. MFBT
    8. Mozilla projects
    9. Preference system
    10. WebIDL bindings
    11. XPCOM
    12. XUL
  3. Building and contributing
    1. Build instructions
    2. Configuring build options
    3. How the build system works
    4. Mozilla source code
    5. Localization
    6. Mercurial
    7. Quality assurance
    8. Using Mozilla code in other projects