Reputation: 562
How can I get the installed version of my Firefox extension, e.g. to show it in the About dialog?
Upvotes: 0
Views: 156
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