It's got to get better!

I'm a Mozilla lover but also an Mozilla extension developer. And those two things doesn't always combine.

I've developed the Launchy and Linky extension and I'm trying to provide the Mozilla users the best experience. But it's not easy.

Here are some of the problems that I've experienced:

Wrong documentation
Ben Goodger has written some documentation on how to write Firefox/Thunderbird Extensions. The problem is that there are two versions of the document. So if you follow the guidelines in the document at http://www.bengoodger.com/software/mb/extensions/howto.html then you have to read the new document which is located here. Why isn't the old document removed? Why create this unnessesary confusen? I dont know. But now you know which document to read and which not to read.

em:maxVersion
In the install.rdf file you specify which applications your extensions work in. It's done by something like this:
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>0.7</em:minVersion>
<em:maxVersion>1.2</em:maxVersion>

Now my questions are: what should I write in maxVersion? 0.9 or 1.2 like in the documentation? And since there's nothing called 1.2 isn't that a bit weird?

Preferences
The biggest problem I had in my extensions with both Mozilla and Mozilla Firefox is the preferences. Each browser has it's own way of showing the preferences dialog for extensions.

Mozilla
In Mozilla you can add a preferences dialog via an overlay to preftree.xul. In your overlay document you can the have the following code to initialize the extension preference dialog onload="parent.initPanel('chrome://launchy/content/options.xul');. This will call a function called Startup in your JavaScript. Here you can do your stuff before the panel loads. Mozilla automaticlly handles all of the saving of prefs when the users closes the preferences as long as you remember to put your pref strings into a array called _elementIDs.

Mozilla Firefox 0.8
In Mozilla Firefox 0.8 it works a bit different. To add a preference dialog you add chrome:settingsURL to your contents.rdf file. You cant use the same file (options.xul) as in Mozilla, since JavaScript function initPanel isn't defined. So to fix this you can have another options.xul file. This file needs the following onload="PrefInit();" ondialogaccept="PrefSave();" which takes care of doing the initialization. Both PrefInit and PrefSave are functions you need to write your self.

Mozilla Firefox 0.9
In Mozilla Firefox 0.9 it again works a bit different. It seems that you need to to have onload="onLoad();" ondialogaccept="onOK();" which then again calles window.opener.top.initPanel(window.location.href, window); which then again calles a special function called Startup. The saving of the preferences is done by calling another special function window.opener.top.hPrefWindow.wsm.savePageData(window.location.href, window);

Arghhhh!
Giving up? This is the biggest problem with Mozilla. The lack of standards between versions and the lack of a examples by the people who implemented the frameworks.

10 different ways to do one thing
If you download some extensions you will see 10 different ways of starting the extensions and at least 20 ways to handling preferences. Some load their extensions using XBL, some just scripts inside their XUL files, some use extenal JavaScripts, some use addEventListener. What is the correct and fastest way to do it? I dont know! I've simply given up!

Hope
I would really really like the Ben Goodger or someone else official released a "standard" extension which contained everything. An extension that worked in both Mozilla and Mozilla Firefox. I can live with something that just works in Mozilla 1.7 and Mozilla Firefox 0.9. I would like to see loading and saving of preferences. Also how to overlay context menus is important since most extensions do that.


June 16, 2004 04:14 PM | Posted in Mozilla

Ads:

Back Next

14 Comments

I would think it's very unlikely that Ben would want to do that. Firefox broke compatibility between 0.8 and 0.9, so he presumably thinks that extensions can/should do that too. Also, the suite is pretty much obsolete (at least in his view), so you wouldn't develop for that either.

The problem is that you've decided to support old stuff, while he/they are busy dumping it all in favour of the new.

Aside from that, there is supposed to be a new project for doing developer documentation, aimed at meeting your needs. It just hasn't happened yet...

Comment by michaell at June 16, 2004 04:54 PM | Permalink

But we still need a "example" extension for the 0.9 framework that shows how to do stuff correctly. I really could use some prefs loading/saving docs/examples. And not just some stuff, the right stuff. Meaning that I can always just download a bunch of extensions and see how other people done it, but I dont want to do that I want to do it the right way!

Site icon Comment by Henrik Gemal at June 16, 2004 05:19 PM | Permalink

> The problem is that there are two versions of the document.
Sadly this is wrong -> http://www.mozilla.org/projects/firefox/extensions/manifest.html

Comment by Anonymous at June 16, 2004 05:27 PM | Permalink

I totally agree with you Henrik. I've been meaning to upgrade my ImageZoomer extension for a long time now. I've partly put it off because of laziness, but mostly because I can never find a standard way of doing things. 95% of my extension development learning has been through just unzipping XPIs and viewing the source. An example extension that covered all the bases would be _MOST_ appreciated.

Site icon Comment by travis at June 16, 2004 06:43 PM | Permalink

Why the hell isn't that document on mozilla.org/projestc/firefox/?

Site icon Comment by Greg K Nicholson at June 16, 2004 08:19 PM | Permalink

Extension preference is a headache. I was lost when I began to implement it in my extension. My option is to use XBL and save the pref at every textbox or checkbox changes. Works well with lasts FFx and Moz versions.
Sure, a standard extension will be very wellcome.

Site icon Comment by gbitten at June 16, 2004 11:23 PM | Permalink

I know how you feel. I wouldn't dare release anything of my own works without working examples to demonstrate what's supposed to happen.

Ditto docs.

Comment by Alex Vincent at June 16, 2004 11:37 PM | Permalink

I understand your plead, but not your pain.

Things like Context Menu's etc are pretty standard in most extension, all it takes is looking at the source. Yes, this should be documented, but most people would rather spend their time hacking on their extension than writting documentation.

Anyhow, my extension QuickNote works on Firefox 0.5,0.6,0.7,0.8, Mozilla 1.x, Thunderbird 0.5, 0.6, 0.7
and all Netscape releases.

Feel free to use any of the code you find usefull. I try and document things as much as I can in the source files.

Also, for converting your extension to the new EM, I wrote a document to make things easier.

http://jedbrown.net/mozilla/EM/

Cheers
-Jed

Site icon Comment by Jed at June 17, 2004 08:03 AM | Permalink

I understand your plead, but not your pain.

Things like Context Menu's etc are pretty standard in most extension, all it takes is looking at the source. Yes, this should be documented, but most people would rather spend their time hacking on their extension than writting documentation.

Anyhow, my extension QuickNote works on Firefox 0.5,0.6,0.7,0.8, Mozilla 1.x, Thunderbird 0.5, 0.6, 0.7
and all Netscape releases.

Feel free to use any of the code you find usefull. I try and document things as much as I can in the source files.

Also, for converting your extension to the new EM, I wrote a document to make things easier.

http://jedbrown.net/mozilla/EM/

Cheers
-Jed

Site icon Comment by Jed at June 17, 2004 08:05 AM | Permalink

I understand your pain.
Although it's not easy to write documentation, expecially when you'd rather be working on your extension or favorite project. Hopefully Ben will get around to doing this by 1.0, or that us the community will get a heads start. I would if my writting skillz were better.

In the mean-time, my Extension QuickNote works in Firefox 0.5, 0.6, 0.7, 0.8 and 0.9. Mozilla 1.x, Thunderbird 0.5, 0.6 and 0.7
and all Netscape 7.x releases. Feel free to grab any code you would like. I try and document everything internally as much as possible.

Also, for converting your extension, I wrote a document to make it easier
http://jedbrown.net/mozilla/EM/

Cheers
-Jed

Site icon Comment by Jed at June 17, 2004 08:30 AM | Permalink

Quasi off topic. The new version of Linky doesn't seem to be installing on the 0.9 (regular download edition). The old version worked great in 0.8.

I don't know if I'm missing a direction and somehow need to uninstall the old. I download the new and it shows in my extensions, but the functionality never appears when I highlight & rightclick several links. I've restarted & tried everything a user would do.

Suggestions? Thoughts?

Site icon Comment by Kevin Donahue at June 19, 2004 01:15 AM | Permalink

In the hope of 'trying everything', I blew out the install, deleted all firefox versions, and did a clean firefox 0.9 install. Re-installed linky. Works great.

Site icon Comment by Kevin Donahue at June 19, 2004 01:22 AM | Permalink

I'll be perfectly honest - I don't have time to do QA/documentation work, I encourage someone to make a variety of extension test cases and examples and check them into http://www.mozilla.org/projects/firefox/qa/extensions/

This would be greatly appreciated.

Site icon Comment by Ben Goodger at July 3, 2004 04:05 AM | Permalink

the following code works just fine with IE based browsers but not with mozill:
window.opener.PostTopic.Message.value=window.opener.PostTopic.Message.value + "\n\n[b]Attachment:[/b] [url=\"\"][/url] ";

any fix for that.

Comment by flashback at September 13, 2004 04:57 PM | Permalink

Post a comment




Remember Me?




Please enter the security code you see here

.
You're here: Home - It's got to get better!
Get the Mozilla Firefox browser