Is it possible to convert a Google Chrome extension to a Firefox or Safari browser extension?

- 15,870
- 7
- 64
- 76

- 1,071
- 2
- 9
- 12
-
Here's the official guide to how to convert Chrome extensions to Firefox add-on using WebExtensions - https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Porting_a_Google_Chrome_extension – Gaurang Tandon Mar 06 '17 at 11:35
-
1Check it here. https://stackoverflow.com/questions/47157086/how-to-install-chrome-extension-to-firefox/47157087#47157087 – Atif Hussain Nov 07 '17 at 11:54
6 Answers
Both Chrome and Firefox add-ons are essentially based on a JavaScript core, but Firefox is, by design, much more extensible. The Gecko engine and XUL (Mozilla's XML User Interface Language) allow for a much larger degree of freedom in what you can do with your extension, while Chrome (and WebKit) try to sandbox the working of its 'apps'.
So, yes, a Chrome extension can almost definitely be made into a Firefox extension, provided Firefox provides an API for whatever it is that you are trying to do. Just replace the Chrome's DevTools SDK-specific content with Firefox's Jetpack SDK-specific content (such as system calls or whatever else it is that you do within your extension).
The opposite, on the other hand, is not always true. Depending on the functionality in a Firefox extension, it cannot always be converted to work in Chrome.
I have created a Chrome Api for Safari and Firefox. I've converted a rather large extension to Safari and Firefox using these translation APIs. I have seen that many people ask about possibilities for convert extensions between browsers and I hope someone can help me to complement the APIs with several methods and a task runner to automate the conversion. There is currently a bit of manual work to be done.
https://github.com/kritollm/chrome-extension-api-for-safari-and-firefox
After I first wrote this post, I have been aware of two other projects which are very similar.
https://code.google.com/p/adblockforchrome/source/browse/trunk/port.js and

- 165
- 2
- 11
-
Your project is very interessing. We really need it. I hope you'll find help. Please, update this topic if you manage to make it work. – Quidam Jul 03 '15 at 14:20
-
1@user3717718 Kristian, that's a great idea. I know it's been years, but would this code still work? Any chance you could eloborate the ReadMe a bit? – LBogaardt Apr 01 '19 at 12:32
Mozilla are working on their WebExtensions API. They say that with the API Porting add-ons to and from other browsers should be easier.

- 654
- 10
- 32
As of Safari 14/MacOS 11/MacOS 10.16/the year 2020, Safari is adopting the Chrome/Firefox extension APIs under the term "Safari Web Extensions". There is a converter described here.

- 15,870
- 7
- 64
- 76
Mozilla now provides this tool https://www.extensiontest.com to test chrome extension’s compatibility with Firefox. When you submit the .crx file it gives you a report about compatibility issues found.
You can create .crx file in chrome browser
More resources
chrome incompatibilities with Mozilla:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Chrome_incompatibilities
Porting a Google Chrome extension: https://extensionworkshop.com/documentation/develop/porting-a-google-chrome-extension/

- 42,508
- 29
- 229
- 225
There is an actively maintained project on GitHub allowing the use of the Chrome Extension API for writing Safari extensions, see https://github.com/avast/topee.
While Google Chrome, Firefox and Edge share the same extension API, Safari extensions are going in a different direction, requiring developers to use a different set of APIs and partly also Swift instead of JavaScript.
The Topee project provides the Google Chrome Extension API for Safari, allowing you to run a single codebase on all the browsers.
The API is complete enough to run in production, such as the extension delivered with Avast Passwords for Mac.

- 37,128
- 15
- 99
- 111