When will web-ext support Manifest v3?

I am starting a project to create a cross-browser extension and want to know what I should be tooling with. Chrome is forcibly deprecating all manifest v2 extensions running next year and in a few days will disable the ability to even add them to their store.

Are there plans to update web-ext to support manifest v3 any time soon? It would be better for me to develop for chrome until Firefox completely migrates to v3 based on my understanding unless web-ext is able to support manifest v3 very soon.

Hi @dleetr! Firefox doesn’t yet support manifest v3, but that shouldn’t deter you from developing and deploying your extension on both platforms. You can still use web-ext run to develop an mv3 version for Chrome and an mv2 version for Firefox. You’ll just need to use two different manifest files (one for mv3 and one for mv2).

At the implementation level, the JS code of the extension should account for the differences between what is possible in Chrome in MV3 (and likely keep most of what the extension was already doing in MV2 unchanged for the Firefox version).

Thanks for the info, this helps a lot to know that I can work with a single toolchain. Do you happen to have a link to repo or other resource that might show a basic setup utilizing 2 different manifest files?

Sorry, I don’t have any examples, but some other folks on this forum might!

Well, I don’t have a repo to share but I can give you some pointers.
What I have a single “src” folder (without manifest file) and then “firefox” and “chrome” folders, each with a manifest file.

Then in the Webpack I use array of configurations to build each browser into it’s own target folder.
And to get the correct manifest file I use copy-webpack-plugin to simply copy content of the browser specific folder into the build.

But now with the manifest V3 it’s gonna be much harder. You will have to refactor existing Firefox code into Manifest V3 compatible one - like using Alarms API and not using any in-memory values. Having a full V3 support in Firefox is not needed, most of the code can be altered already to work in both versions.

I haven’t tried V3 yet though, I’ve only read the migration guide with my mouth opened and I really don’t envy my future self the refactoring and all those unresolved issues. I really really hope they will move the January 2023 deadline as far as possible :slight_smile:.

@dleet Probably not the best practice, but I have been using two different manifests in my project for a while now to support some things that Chrome doesn’t have that Firefox has. I just having a batch/bash file that copies the files to a “build” folder and renames 1 manifest file and deletes the other. Like I said, I’m sure there are better ways to do it, but this is just my “thrown together” way to manage it without having to install a bunch of other tools or build software.

Currently that project is using manifest version 2 for both, but I started working on migrating another project to manifest v3 last week. For the most part, it seems like they both work fairly similarly. The only real thing that’s been throwing me for a loop has been service workers vs background scripts, mostly because I’ve never done service workers before and the life cycle of a service worker has been throwing of my former process. However, I’ve read if you set the persistent property of the background file to false in Firefox, it should work similarly enough to how service workers work in Chrome.

Honestly, I’m really not looking forward to migrating to manifest V3. I’d rather stay with manifest V2, but that’s just how technology progresses I guess.