Firebird 0.8 InstallTrigger API - get your icons ready!

Talk about add-ons and extension development.
User avatar
bengoodger
Posts: 318
Joined: November 4th, 2002, 4:24 pm
Location: Campbell, CA
Contact:

Firebird 0.8 InstallTrigger API - get your icons ready!

Post by bengoodger »

For Firebird 0.8 I'm enhancing the InstallTrigger.install method:

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.
Last edited by bengoodger on December 17th, 2003, 11:04 pm, edited 2 times in total.
TychoQuad
Posts: 1263
Joined: December 11th, 2002, 12:30 am
Location: Australia

Post by TychoQuad »

Looks great! just like the download manager :)
User avatar
frease
Posts: 3981
Joined: September 16th, 2003, 1:17 pm

Post by frease »

Not bad :)
User avatar
mai9
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona
Contact:

Post by mai9 »

Can we use the red fire icon? ;)
Torisugari
Posts: 1634
Joined: November 4th, 2002, 8:34 pm
Location: Kyoto, Nippon (GMT +9)
Contact:

Post by Torisugari »

According to bengoodger's opinion in this thread. install.js does not have important information any more. Then it's reasonable that new install trigger method handles JAR file url(or contents.rdf file) instead of XPI file url.
User avatar
Pike
Posts: 2293
Joined: August 10th, 2003, 12:12 pm
Location: UK
Contact:

Post by Pike »

And here was me worrying my page was going to be broken by this, makes me wish I could draw so I could make some nice icons.

One problem I have had was that under the current system it takes a while for the box to popup (hence the "Downloading, please wait" alert, to let people know something is happening) would it be possible to have the box appear as soon as InstallTrigger.install is called, even if you don't know the linked extensions exist yet?

p.s. And does anyone know how to "sign" extensions (now there's a big scary red label)?
User avatar
Chris Cook
Posts: 898
Joined: December 14th, 2002, 9:57 am
Location: Québec, Canada
Contact:

Post by Chris Cook »

Pike wrote:p.s. And does anyone know how to "sign" extensions (now there's a big scary red label)?

Does it matter? The only signed active-x component I ever saw in IE was from MS ;-)
TheOneKEA
Posts: 4864
Joined: October 16th, 2003, 5:47 am
Location: Somewhere in London, riding the Underground

Post by TheOneKEA »

Wow, cool!

Any ideas on when it will appear in the Linux trunk?
Proud user of teh Fox of Fire
Registered Linux User #289618
User avatar
alanjstr
Moderator
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here
Contact:

Post by alanjstr »

Just because MS Signs a component doesn't make it safe. They've proven that.
Former UMO Admin, Former MozillaZine General Mod
I am rarely on mozillaZine, so please do not send me a private message.
My Old Firefox config files
User avatar
Jeff_pony
Moderator
Posts: 8790
Joined: January 5th, 2003, 12:38 pm
Location: (.uk)
Contact:

Post by Jeff_pony »

Does this apply to the way in which themes are installed?
Please PM the mod team when you see a rule infraction
Life State:: McLovin it
Camino v2.1 (pre)
jedbro
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.
Contact:

Sounds good

Post by jedbro »

This sounds great :)
User avatar
wget
Posts: 4701
Joined: November 8th, 2002, 9:51 am
Location: Denmark

Post by wget »

This looks very nice except for one detail; the truncating of the download url. Wouldn't it look better if it reported the path, let's call it http://url.to/longdir/evenlongerdir/my.extension.xpi, as being http://url.to/longdir/.../my.extension.xpi?

The full untruncated path, the filesize, the date and a description of the extension could also be accessible by simply mousing over the extension in question.
To the cast and crew of Arrested Development: Thanks for the many great laughs.
User avatar
bengoodger
Posts: 318
Joined: November 4th, 2002, 4:24 pm
Location: Campbell, CA
Contact:

Post by bengoodger »

wget wrote:This looks very nice except for one detail; the truncating of the download url. Wouldn't it look better if it reported the path, let's call it http://url.to/longdir/evenlongerdir/my.extension.xpi, as being http://url.to/longdir/.../my.extension.xpi?

The full untruncated path, the filesize, the date and a description of the extension could also be accessible by simply mousing over the extension in question.


It doesn't really truncate the file path.. it's a selectable field so you can see the whole thing. I don't know, maybe cropping in the middle would be better. I don't know.
User avatar
alanjstr
Moderator
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here
Contact:

Post by alanjstr »

It is something to ponder. Not a critical issue.
Former UMO Admin, Former MozillaZine General Mod
I am rarely on mozillaZine, so please do not send me a private message.
My Old Firefox config files
User avatar
wget
Posts: 4701
Joined: November 8th, 2002, 9:51 am
Location: Denmark

Post by wget »

alanjstr wrote:It is something to ponder. Not a critical issue.

Of course not, polish seldom is.
To the cast and crew of Arrested Development: Thanks for the many great laughs.
Post Reply