Learn on hard way
Learn on hard way

Reputation: 336

Limit Firefox extension on specific browser versions

I am building a firefox extension and I want it to run on a specific browser version.

For example, if the user has Firefox 50 and in the settings (manifest.json I believe), I have set to run only on 48 or lower, then don't enable the extension. And if someone comes and downloads the extension and has a version 46, then the extension would run.

Is there a possibility to make that kind of restriction?

Upvotes: 0

Views: 134

Answers (1)

Xan
Xan

Reputation: 77482

You need to use browser_specific_settings key in the WebExtension manifest:

strict_max_version: maximum version of Gecko to support. If the Firefox version on which the extension is being installed or run is above this version, then the extension will be disabled, or not permitted to be installed. Defaults to "*", which disables checking for a maximum version.

"browser_specific_settings": {
  "gecko": {
    "id": "[email protected]",
    "strict_max_version": "48.0"
  }
}

You can set both min and max version this way.

Upvotes: 1

Related Questions