WebExtensions are designed to be compatible with Chrome and Opera extensions: as far as possible, extensions written for those browsers should run on Firefox with minimal changes.

However, Firefox currently has support for only a limited set of the features and APIs supported by Chrome and Opera. We're working on adding more support, but many features are not yet supported, and we may never support some.

This article lists all features and APIs that are fully or partially supported in Firefox Developer Edition. Where a feature is partially supported, we've indicated what the gaps are.

You should assume that features and APIs not listed here at all are not yet supported.

JavaScript APIs

Callbacks and the chrome.* namespace

In Chrome, extensions access privileged JavaScript APIs using the chrome namespace:

chrome.browserAction.setIcon({path: "path/to/icon.png"});

WebExtensions access the equivalent APIs using the browser namespace:

browser.browserAction.setIcon({path: "path/to/icon.png"});

Many of the APIs are asynchronous. In Chrome, asynchronous APIs use callbacks to return values, and runtime.lastError to communicate errors:

function logCookie(c) {
  if (chrome.extension.lastError) {
    console.error(chrome.extension.lastError);
  } else {
    console.log(c);
  }
}

chrome.cookies.set(
  {url: "https://developer.mozilla.org/"},
  logCookie
);

The equivalent WebExtensions APIs use promises instead:

function logCookie(c) {
  console.log(c);
}

function logError(e) {
  console.error(e);
}

var setCookie = browser.cookies.set(
  {url: "https://developer.mozilla.org/"}
);
setCookie.then(logCookie, logError);

As a porting aid, the Firefox implementation of WebExtensions supports chrome and callbacks as well as browser and promises. This means that many Chrome extensions will just work in Firefox without any changes. However, this is not part of the WebExtensions standard, and might not be supported by all compliant browsers.

If you do write your WebExtension to use browser and promises, then we've also developed a polyfill that will enable it to run in Chrome: https://github.com/mozilla/webextension-polyfill.

Partially supported APIs

The page Browser support for JavaScript APIs includes compatibility tables for all APIs that have any support in Firefox. Where there are caveats around support for a given API item, this is indicated in these tables with an asterisk "*" and in the reference page for the API item, the caveats are explained.

These tables are generated from compatibility data stored as JSON files in GitHub.

The rest of this section describes compatibility issues that are not already captured in the tables.

notifications

  • For notifications.create(), with the "basic" type, iconUrl is optional in Firefox. It is required in Chrome.
  • Notifications are cleared immediately when the user clicks on them. This is not the case in Chrome.
  • If you call notifications.create() more than once in rapid succession, Firefox may end up not displaying any notification at all. Waiting to make subsequent calls until within the chrome.notifications.create() callback function is not a sufficiently long delay to prevent this from happening.

tabs

  • In Firefox, relative URLs passed into tabs.executeScript() or tabs.insertCSS() are resolved relative to the current page URL. In Chrome, these URLs are resolved relative to the add-on's base URL. To work cross-browser, you can specify the path as an absolute URL, starting at the add-on's root, like this:

    /path/to/script.js
  • In Firefox, querying tabs by URL with tabs.query() requires "tabs" permission. In Chrome, it's possible without the "tabs" permission but will limit results to tabs whose URLs match host permissions.

webRequest

  • In Firefox requests can be redirected only if their original URL uses the http: or https: scheme.

windows

  • In Firefox onFocusChanged will trigger multiple times for a given focus change.

Planned APIs

We don't support the following APIs, but plan to, soon:

This doesn't mean that these are the only additional APIs we will support, but that they are our current priorities.

Miscellaneous incompatibilities

URLs in CSS

Firefox resolves URLs in injected CSS files relative to the CSS file itself, rather than to the page it's injected into.

Additional incompatibilities

Firefox does not support using alert(), confirm(), or prompt() from background pages.

manifest.json features

Fully supported keys

Partially supported keys

background

Firefox does not support the "persistent" property. Background scripts stay loaded all the time.

commands

Firefox does not support:

  • Media keys as shortcuts
  • global
  • the special command _execute_browser_action

content_scripts

Firefox does not support:

  • match_about_blank

In Firefox, content scripts declared in the manifest will be injected into existing tabs on each extension load. In Chrome, content scripts do not apply to tabs already open when extension is loaded.

content_security_policy

Firefox does not support:

  • "http://127.0.0.1" or "http://localhost" as script sources: they must be served over HTTPS.

options_ui

Firefox does not support:

  • chrome_style

Using options_ui requires a valid value for the applications.gecko.id property.

permissions

Firefox does not support the following permissions:

  • background
  • clipboardRead
  • geolocation
  • unlimitedStorage

Obviously, it doesn't support permissions for APIs that are themselves not supported.

incognito

Firefox does not support the following incognito (private browsing) modes:

  • split

Document Tags and Contributors

 Last updated by: Xan,