Currently you install an extension from script by doing this:
Code: Select all
InstallTrigger.install({ "My Extension": "http://url.to/my.extension.xpi" });
From Firebird 0.8, in addition to this you will be able to do this:
Code: Select all
var params = {
URL: "http://www.site.com/foo.xpi",
IconURL: "http://www.site.com/foo.gif",
toString: function() { return this.URL; }
};
InstallerTrigger.install({ "My Extension": params);
(thanks to Benjamin Smedberg for this example). This function is NOT supported in Mozilla 1.6 or older versions of Firebird, and thus the toString() method is necessary if you want your extensions to be installable into Mozilla 1.6 or Firebird 0.7 or earlier.
Basically you will be able to pass an object with two fields to the install function - one is the URL to install to, one is the URL to a 32x32 icon (it must be 32x32, if it isn't it'll be shrunken or expanded to fit that dimension, and in any image format Mozilla supports) which will appear in the UI as your extension is installed:
<img src="http://www.bengoodger.com/software/mb/xpinstall/softwareUpdateSingleWithIcon.png">
If you don't provide an IconURL field, or you use the old style API (which will continue to work for compatibility reasons), you will get a generic icon:
<img src="http://www.bengoodger.com/software/mb/xpinstall/softwareUpdateMultiple.png">
This code is now available on the 0.8 branch, get testing builds from the latest-0.8 nightly directory on the ftp site.