I have created my Web Extension for Firefox which uses Chrome Extension API.
But Firefox requires application
key in manifest.json
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json
If I load the same extension for Google Chrome, Chrome warns as:
There were warnings when trying to install this extension: Unrecognized manifest key 'applications'.
Although the extension works, I am not sure if I can send a Firefox Web Extension to Google Chrome Store with this manifest file.
I can create another project for Google Chrome but I want to keep a single folder that may work for both Firefox and Google Chrome without any warnings.
How I am suppose to fix this warning while keeping Firefox requirements?
Manifest V3 is the latest set of changes to the Chrome browser's rules for browser extensions. Each extensions manifest version update introduces backwards-incompatible changes to ostensibly move the platform forward.
You can just use chrome. runtime. getManifest() to access the manifest data - you don't need to GET it and parse it.
Manifest V2 support ends in June of 2023 for all Chromium-based browsers.
You probably want to generate separate manifest files even if everything else is unchanged. After all, the docs state:
applications
. Only supported in Gecko.
My recommendation is a build script that copies over the files and the correct manifest for each version (or dynamically generates the correct manifest if you want fancy).
Running 68.0b13 (64-bit), I just deleted the "applications" key and body
// "applications": { // "gecko": { // "strict_min_version": "58.0a1" // } // },
and it works fine without it.
Documentation says:
Note that the ability to develop and debug WebExtensions that don't include an ID is new in Firefox 48. If you need to use an earlier version of Firefox, then you must use the applications key to set an ID explicitly.
My interpretation of that is that the "application" key is NOT necessary for >=
Firefox 48.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With