5 ms·
If I want to build a cross platform browser extension is there an easier way then having to write it twice?
by nassimsoftware 4y ago
If I want to build a cross platform browser extension is there an easier way then having to write it twice?
- wongarsu 4y agoLast time I wrote an extension (which is a while ago) the changes between the Chrome and Firefox version were minimal. And Edge takes unmodified Chrome extensions. Obviously depends on the APIs you want, but a typical extension should be trivial to make compatible and package for both Chrome and Firefox.
- lab 4y agoThe Plasmo framework has a couple feature that you can use to specify bundle specific behavior at the compilation level (via env or via file): https://docs.plasmo.com/framework/workflows/build#with-a-specific-target https://docs.plasmo.com/framework/workflows/build#with-a-spe... Disclaimer: I'm the author and maintainer of the framework.
- insin 4y agoThis _was_ easy the last time I created a new extension, as Firefox also supports the `chrome` namespace for extension APIs, but now that Chrome Web Store isn't accepting new Manifest V2 extensions, you'll at the very least have to have separate manifest files for MV2 and MV3 versions, and different implementations where relevant for MV2 and MV3 (depending on which features your extension needs - e.g. if your extension is really just a way to inject a content script into a page, you might just need separate manifest files).