Sergii
Sergii

Reputation: 562

Get the version of an installed Firefox extension

How can I get the installed version of my Firefox extension, e.g. to show it in the About dialog?

Upvotes: 0

Views: 156

Answers (1)

Wladimir Palant
Wladimir Palant

Reputation: 57691

You use the AddonManager API:

Components.utils.import("resource://gre/modules/AddonManager.jsm");
AddonManager.getAddonByID("[email protected]", function(addon)
{
  alert("Installed version is " + addon.version);
});

Here [email protected] needs to be replaced by the ID of your add-on of course.

Upvotes: 3

Related Questions