cho.sh
Porting a Chrome Extension to Firefox Add-on

Porting a Chrome Extension to Firefox Add-on

Warning

Over a year old. May be outdated

Chrome and are two very different browsers, but Chrome Extension and Add-on are now more similar than ever. So it is possible to port a Chrome extension to a Add-on and ship it to the Mozilla store with minor changes. Here's how I ported to .

Checking the Chrome incompatibilities

can run commands with the chrome namespace, such as chrome.tabs.onUpdated. However, a few codes still exist that cannot run. offers a handy website to check the chrome incompatibilities.

  1. On your Chrome browser (or on any equivalent Chromium browsers,) visit chrome://extensions.
  2. Enable Developer Mode and Press Pack Extension.
  3. Select your extension directory and pack your extension. That will create a .crx file.
  4. Visit the Firefox Extension Test website and upload your .crx file.
  5. You are fine if it says there is no problem.

If there is any problem, I advise you to visit the MDN docs and see what code caused the problem. Unfortunately I had no problem, so I cannot share any experience here.

Adding Manifest ID

also requires an ID in manifest.json, like this.

json
"browser_specific_settings": {
  "gecko": {
    "id": "addon@example.com",
    "strict_min_version": "42.0"
  }
},

As you can see, you can also add a strict_min_version here. See the MDN docs.

This was a minor hassle since Chrome could not recognize the above code block. So you need to keep two manifests, one with it (for Firefox) and one without (for Chrome). If I find a more straightforward way, I will add it here.

Uploading it to the Add-on Store

  1. Visit https://addons.mozilla.org/.
  2. Log in to your developer account (or create a developer account).
  3. Visit Firefox Submit a New Add-on page.
  4. Follow the guidelines on the screen.

One little tip. Make sure you don't include any unnecessary files like .DS_Store. Using macOS's default Finder compressor will sometimes have these files. I recommend using Keka.

Update

Backlinks3