-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Specify manifest.json
path
#2653
Comments
There was recent discussion of this scenario at issue #2281. From a different angle, not the tooling perspective, but the browser engineering one: There is consensus across browser vendors that unsupported properties should be ignored (potentially with a warning to developers), but should not prevent the extension from being loaded. The Presently, Chrome refuses to load the extension and reports "The "background.scripts" key cannot be used with manifest_version 3. Use the "background.service_worker" key instead." In the future, Chrome will not refuse to load the extension any more: w3c/webextensions#282 (comment) & w3c/webextensions#282 (comment) (https://bugs.chromium.org/p/chromium/issues/detail?id=1418934). Until that bug has been fixed and shipped for a while, extension authors still need to customize the manifest per browser. But longer-term, the cross-browser developer experience will hopefully be better than it is today. |
I understand. To go further, Firefox currently also refuses As web-ext is meant to ease web extension development, I presumed the developer angle would be the main (if not the only) to be considered. I know the whole Manifest v3 move is painful for everyone (except Google / Chrome, yet struggling with their own deadlines and nonsenses). |
Ideally, extension authors should be able to use one source dir for both Chrome and Firefox. When that is not possible (e.g. due to Chrome refusing to load when When that is not possible, i.e. when an two manifest.json files are needed, then there would be a need to have an intermediate build step. Sometimes it's just one manifest.json file, but often the degree of incompatibilities means that there are also differences in source files. Therefore the generic solution is to introduce a build step and run
I'll mark this as wontfix, but keep it opened for visibility, since the incompatible manifest.json is a frequently encountered issue as developers try to develop MV3 extensions for Firefox and Chrome. |
Thanks for the detailed answer, makes sense! |
Reviving #1034.
Currently working on a manifest V2 → V3 migration, separate manifest files are needed for Firefox and Chromium based browsers:
background
entry needs aservice_worker
string for Chromium, but ascripts
strings array for Firefox ;browser_specific_settings
mostly to setgecko.id
.I currently have two manifests, and use npm scripts to temporary rename e.g. the Firefox manifest before packaging my extension. I can't see a workaround since browsers reject a manifest containing what they consider as invalid entries in the manifest file—but that's the only file that needs to be different. Content and background scripts, assets, images… are the same for Firefox and Chromium, so I definitely don't want to maintain a folder for both, with duplicate files all over.
That means I'm unable to use web-ext to either build or run my extension since I cannot specify the manifest file to use. I could keep going with temporarily renaming files before using web-ext (using
pre
npm script hooks), which I’d like to drop, obviously.Could it make sense to handle this argument for web-ext CLI with the the upcoming MV3 era? And if not, I think it could be explained somewhere with some hints and how-to handle this, couldn't it?
The text was updated successfully, but these errors were encountered: