While Chrome and Firefox are two very different browsers, Chrome Extension and Firefox Add-on are now more similar than ever. Therefore, it is possible to transplant a Chrome extension to a Firefox Add-on and publish it to the Mozilla store with minor changes. This post is about how I transplanted my YouTube Comment Language Filter to Firefox.
First, Firefox can run commands with the
chrome namespace, such as
chrome.tabs.onUpdated. However, a few codes still exist that Firefox cannot run. Firefox offers a handy website to check the chrome incompatibilities.
- On your Chrome browser (or on any equivalent Chromium browsers,) visit
- Enable Developer Mode and Press Pack Extension.
- Select your extension directory and pack your extension. That will create a
- Visit the Firefox Extension Test website and upload your .crx file.
- 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.
Firefox also requires an ID inside the
manifest.json file. It is like the following.
"id": "[email protected]",
As you can see, you can also add a
strict_min_version here. See original MDN docs.
This was a minor hassle since Chrome could not recognize the above code block. So you need to keep two
manifest.json, one with the above code block (for Firefox) and one without it (for Chrome). If I find a more straightforward way, I will add it here.
- Visit https://addons.mozilla.org/.
- Log in to your developer account (or create a developer account).
- Visit Firefox Submit a New Add-on page.
- Follow the guidelines on the screen.