Skip to content

Can one browser extension work in both Chrome and Firefox?

How much of a Chrome extension runs in Firefox, what differs, and what you need to publish on Mozilla's add-ons site.

If you build a Chrome extension, you will soon be asked: "Can it also work in Firefox?" In many cases, yes. This guide explains why, and what to check. It is based on Mozilla's documentation, which changes over time, so check the current compatibility tables before you rely on a detail.

Why it is often possible

Firefox extensions are built on the WebExtensions API, which is largely compatible with the APIs used in Chromium-based browsers such as Chrome. Mozilla says extensions written for Chromium-based browsers can run in Firefox with only a few changes (Build a cross-browser extension).

Firefox also supports the chrome.* namespace and callbacks, as well as browser.* and promises, so code written for Chrome can run largely unchanged (same guide).

What differs

  • Background code. In Manifest V3, Chrome replaced background pages with extension service workers. Firefox keeps using background pages (MDN).
  • Manifest keys. Some manifest keys exist in only one browser. MDN suggests keeping a separate manifest file for each browser.
  • Namespace and promises. Firefox has always used browser.* with promises. Chrome has added support over time; MDN's guide lists the Chrome versions, so check it for the version you target.

Testing in Firefox

Mozilla's porting guide suggests: review your code against the list of Chrome incompatibilities, test the extension in Firefox using about:debugging or the web-ext tool, package it, and then submit it for signing and distribution (Porting a Google Chrome extension).

Publishing on addons.mozilla.org

  • Listing on addons.mozilla.org (AMO) is optional, but an add-on must be signed by Mozilla, otherwise users cannot install it.
  • To publish on AMO the manifest must declare the gecko property with an id, and data_collection_permissions (MDN).
  • Mozilla says its pre-publication review is automatic, and a manual review can follow after publication, which can lead to suspension if problems are found.

When it is worth it

A second browser means more testing and a second store listing to keep up to date. It makes sense when your users are likely to use Firefox, or when you want to reach as many people as possible. If you are not sure, start with Chrome and add Firefox later.

We can help

We build extensions for Chrome and Firefox. In our estimate tool, "Firefox version" is an option on a browser extension project. Consultation is free.

Sources

Share this post