MozillaZine

Firebird 0.8 InstallTrigger API - get your icons ready!

Talk about add-ons and extension development.
bengoodger

User avatar
 
Posts: 318
Joined: November 4th, 2002, 4:24 pm
Location: Campbell, CA

Post Posted December 11th, 2003, 12:53 am

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 Posted December 11th, 2003, 12:55 am

Looks great! just like the download manager :)

frease

User avatar
 
Posts: 3981
Joined: September 16th, 2003, 1:17 pm

Post Posted December 11th, 2003, 1:59 am

Not bad :)

mai9

User avatar
 
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona

Post Posted December 11th, 2003, 4:51 am

Can we use the red fire icon? ;)

Torisugari
 
Posts: 1634
Joined: November 4th, 2002, 8:34 pm
Location: Kyoto, Nippon (GMT +9)

Post Posted December 11th, 2003, 7:15 am

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.

Pike

User avatar
 
Posts: 2293
Joined: August 10th, 2003, 12:12 pm
Location: UK

Post Posted December 11th, 2003, 8:37 am

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)?

Chris Cook

User avatar
 
Posts: 898
Joined: December 14th, 2002, 9:57 am
Location: Québec, Canada

Post Posted December 11th, 2003, 12:59 pm

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

User avatar
 
Posts: 4864
Joined: October 16th, 2003, 5:47 am
Location: Somewhere in London, riding the Underground

Post Posted December 11th, 2003, 1:48 pm

Wow, cool!

Any ideas on when it will appear in the Linux trunk?
Proud user of teh Fox of Fire
Registered Linux User #289618

alanjstr
Moderator

User avatar
 
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here

Post Posted December 11th, 2003, 1:50 pm

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

Jeff_pony
Moderator

User avatar
 
Posts: 8790
Joined: January 5th, 2003, 12:38 pm
Location: (.uk)

Post Posted December 11th, 2003, 3:27 pm

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

User avatar
 
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.

Post Posted December 11th, 2003, 4:49 pm

This sounds great :)

wget

User avatar
 
Posts: 4701
Joined: November 8th, 2002, 9:51 am
Location: Denmark

Post Posted December 12th, 2003, 4:09 pm

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.

bengoodger

User avatar
 
Posts: 318
Joined: November 4th, 2002, 4:24 pm
Location: Campbell, CA

Post Posted December 13th, 2003, 1:23 am

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.

alanjstr
Moderator

User avatar
 
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here

Post Posted December 13th, 2003, 11:46 am

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

wget

User avatar
 
Posts: 4701
Joined: November 8th, 2002, 9:51 am
Location: Denmark

Post Posted December 13th, 2003, 12:52 pm

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.

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 0 guests