New Extension API - Docs Updated!

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

Post by bengoodger »

ausdilecce wrote:I hate to be a lurker so I'll throw my question to you all.

It is my understanding that this thread applies to Firefix and NOT to Thunderbird. As I have quite a few extensions for TB already (and none for FF :( , the timeline for TB's extension manager update to mimic FFs is what I am looking out for. Is TB's extension manager gonna get the update as well ? If so, approx when ?

Sorry to be a bother, but I don't wanna leave people high and dry .

Cheers and good work Ben !


Scott thinks that thunderbird integration would come in a release after firefox, but it will eventually use the same system.
User avatar
bengoodger
Posts: 318
Joined: November 4th, 2002, 4:24 pm
Location: Campbell, CA
Contact:

Post by bengoodger »

TheOneKEA wrote:I believe that the new Extension Manager will ONLY support installation to the User Profile - I believe that Ben will deliberately prevent installation into the Firefox directory.


Correction - only support installation in the profile from the UI - it'll support global installation from the command line.
User avatar
bytemaster
Posts: 1264
Joined: August 18th, 2003, 11:34 pm
Contact:

Post by bytemaster »

Thanks Ben. That install method will work great.

As far as I am concerned, this is a good balance. No one would really be installing global extensions, except a sys admin, and the command-line is perfect for doing those kind of tasks.

I was afraid that the install would be only to the profile, which doesn't work very well when installing on a multiple user system, such as unix or a Windows Terminal Server.
Brainbench Most Valuable Professional (MVP) for Computer Technical Support
www.brainbench.com - <a href="http://www.brainbench.com/xml/bb/transcript/public/viewtranscript.xml?pid=742832">view my transcript</a>
jedbro
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.
Contact:

Post by jedbro »



Thanks Ben, that's a huge help.

Next question, what about extensions (like QuickNote) that provide their own icon for the windows? For example, currently in my install.js I have the following;

Code: Select all

 
var iconfolder = getFolder(getFolder("chrome", "icons"), "default");
  addFile(name, "quicknote-main.ico", iconfolder, "");
  addFile(name, "quicknote-main.xpm", iconfolder, "");


Can I not get my windows to use a different icon in Firefox 0.9 and + versions?

Also, if I want to keep mozilla 1.x and Firefox 0.8 support, how should I re-shape my install.js to work with the new .xpi herarchy?
Would I still use:

Code: Select all

    
registerChrome(contentFlag, folder, "content/");
registerChrome(skinFlag, folder, "skin/classic/");



Thanks for the acclaration..
User avatar
bengoodger
Posts: 318
Joined: November 4th, 2002, 4:24 pm
Location: Campbell, CA
Contact:

Post by bengoodger »

jedbro wrote:Next question, what about extensions (like QuickNote) that provide their own icon for the windows? For example, currently in my install.js I have the following;

Code: Select all

 
var iconfolder = getFolder(getFolder("chrome", "icons"), "default");
  addFile(name, "quicknote-main.ico", iconfolder, "");
  addFile(name, "quicknote-main.xpm", iconfolder, "");


Can I not get my windows to use a different icon in Firefox 0.9 and + versions?


Oh. Damn.

*bangs head on desk*

Sigh. I understand what you're trying to do, and you should be able to do it. You have however uncovered one of our stupider APIs. I don't know that I can make this work by .9 but I'll look at it for 1.0. Make sure a bug is filed on me.
User avatar
bengoodger
Posts: 318
Joined: November 4th, 2002, 4:24 pm
Location: Campbell, CA
Contact:

Post by bengoodger »

jedbro, what you can do in the interim is place the .ico files in your xpi under the defaults/ dir... then the first time you run, you can attempt to copy them to (bindir)/chrome/icons/...
User avatar
Pike
Posts: 2293
Joined: August 10th, 2003, 12:12 pm
Location: UK
Contact:

Post by Pike »

jedbro wrote:Also, if I want to keep mozilla 1.x and Firefox 0.8 support, how should I re-shape my install.js to work with the new .xpi herarchy?
Would I still use:

Code: Select all

    
registerChrome(contentFlag, folder, "content/");
registerChrome(skinFlag, folder, "skin/classic/");

I just updated (but not uploaded) my extensions and the only change I needed to make in my install.js files to get them to still work in 0.8 was altering addFile to reflect the fact the jar is now in a chrome sub-folder.
User avatar
avih
Posts: 347
Joined: December 30th, 2002, 2:36 pm
Contact:

Post by avih »

is it possible to install a non-JARed extension? i.e. one of the files of my extension is [also] a configuration file, i don't want it to be inside a jar... currently my extension in installed uncompressed.

also, in the samples posted, i don't see an install.js file. if i want my extension to stay compatible with older versions of ff/mozilla/thunderbird, how should i do that?

thx
Tried SmoothWheel already?
TheOneKEA
Posts: 4864
Joined: October 16th, 2003, 5:47 am
Location: Somewhere in London, riding the Underground

Post by TheOneKEA »

bengoodger wrote:
TheOneKEA wrote:I believe that the new Extension Manager will ONLY support installation to the User Profile - I believe that Ben will deliberately prevent installation into the Firefox directory.


Correction - only support installation in the profile from the UI - it'll support global installation from the command line.


Does this mean that a la Profile Manager, you can start the Extension Manager from the command line? Say with the -E switch?
Proud user of teh Fox of Fire
Registered Linux User #289618
mboullet
Posts: 337
Joined: November 5th, 2002, 2:34 am
Location: France
Contact:

Post by mboullet »

Pike wrote:I just updated (but not uploaded) my extensions and the only change I needed to make in my install.js files to get them to still work in 0.8 was altering addFile to reflect the fact the jar is now in a chrome sub-folder.


Do you mean that the following info (provided in current contents.rdf) :

<RDF:Description about="urn:mozilla:package:allinonegest"
chrome:displayName="All-in-One Gestures 0.10.1"
chrome:author="Optimoz, Joe4711, Skidooer; Merged by M. Boullet"
chrome:authorURL="http://perso.wanadoo.fr/marc.boullet/ext/extensions-en.html"
chrome:name="allinonegest"
chrome:settingsURL="chrome://allinonegest/content/pref/pref2-allinonegest.xul"
chrome:extension="true"
chrome:description="This extension allows you to execute blah blah..."
chrome:localeVersion="0.10.1">
</RDF:Description>

will be ignored by the new installer ?
Marc
User avatar
Pike
Posts: 2293
Joined: August 10th, 2003, 12:12 pm
Location: UK
Contact:

Post by Pike »

mboullet wrote:Do you mean that the following info (provided in current contents.rdf) :
[...]
will be ignored by the new installer ?

I have no idea, I've just assuming that it will be until I find out differently.
elliptic
Posts: 9
Joined: May 3rd, 2004, 11:46 am
Contact:

Post by elliptic »

elliptic wrote:One of my extensions installs a default user file to a subdirectory under the User Profile directory, in addition to the application .jar file which is placed in the normal Mozilla chrome directory. The user file can be modified by the extension, i.e. it should be writable. Will the Firefox Extension Management scheme outlined above support this (installation to the User Profile area)?


Just to expand on what I inquired about yesterday... The issue is not so much about installing to the User Profile versus global installation, but rather about installing miscellaneous application files which don't fit into the categories/directories listed in the Firefox Extension Manager API. In my case, my Mozilla extension currently installs a user data file with some initial values into a subdirectory under the User Profile. The user can modify the data file or create new data files by using the appropriate functions in the extension.

Under the proposed Firefox E. M. API, I could install the initial data file under the "defaults" directory, but I have the impression this area is meant for static data for purposes of restoring the extension to its original defaults. Of course, I could copy the file from that location to a more suitable directory when my extension is first run, as Ben suggested to Jedbro for the case of installing icons (http://forums.mozillazine.org/viewtopic ... 923#511923), which would be fine, but then there would be no record for Firefox to use to remove the file and/or directory upon uninstallation.

So I was wondering about the possibility of adding another optional property to the extension.rdf for miscellaneous files and directories, somewhat like the scheme used by the jslib uninstall library: see http://jslib.mozdev.org/libraries/insta ... stall.html

Thanks.
jedbro
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.
Contact:

Post by jedbro »

bengoodger wrote:jedbro, what you can do in the interim is place the .ico files in your xpi under the defaults/ dir... then the first time you run, you can attempt to copy them to (bindir)/chrome/icons/...

OK, thanks, I'll look into that and let you know if it worked although that seems to be allot of code for something so trivial.
I do really hope this can get addressed for 1.0.

elliptic wrote:...... as Ben suggested to Jedbro for the case of installing icons ...., which would be fine, but then there would be no record for Firefox to use to remove the file and/or directory upon uninstallation.

So I was wondering about the possibility of adding another optional property to the extension.rdf for miscellaneous files and directories, somewhat like the scheme used by the jslib uninstall library: see http://jslib.mozdev.org/libraries/insta ... stall.html

Thanks.


I agree. Uninstall really should delete all *extra* files that are mentioned by the author.

Pike wrote:I just updated (but not uploaded) my extensions and the only change I needed to make in my install.js files to get them to still work in 0.8 was altering addFile to reflect the fact the jar is now in a chrome sub-folder.


Thanks Pike, you answered my question.

Thanks again Ben for the feedback
-Jed
User avatar
bengoodger
Posts: 318
Joined: November 4th, 2002, 4:24 pm
Location: Campbell, CA
Contact:

Post by bengoodger »

elliptic wrote:Under the proposed Firefox E. M. API, I could install the initial data file under the "defaults" directory, but I have the impression this area is meant for static data for purposes of restoring the extension to its original defaults.


This is true - it replaces the need to place defaults files in bin/defaults/ by supplying a per-extension location. What you do is you try and load profile/yourconfig.file and if it doesn't exist you copy it out of profile/extensions/{guid}/defaults/yourconfig.file (I will probably provide a shortcut to that path on an extension manager interface so you don't have to synthesize it yourself.

You can of course create any other dirs you want in the .xpi file and use data there - the entire XPI is expanded into the extensions dir.
User avatar
alanjstr
Moderator
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here
Contact:

Post by alanjstr »

bengoodger wrote:I'm going to remove the UI that we have now for extensions and themes (in Options)...


Am I reading that right? You're changing the way themes are installed, too?

Still need to hear from you about GUID.
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
Post Reply