如何获得Firefox扩展的安装版本,例如在“关于”对话框中显示它?
You use the AddonManager API :
Components.utils.import("resource://gre/modules/AddonManager.jsm");
AddonManager.getAddonByID("id@my.addon", function(addon)
{
alert("Installed version is " + addon.version);
});
Here id@my.addon
needs to be replaced by the ID of your add-on of course.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.