We have been putting out the call for extension developers to start the process of updating their extension to workin Firefox 3. It’s never fun when your extension breaks because of changes in Firefox, but everyone wants to make the platform better. In doing so, we had to break some eggs.
On the bright side, extension developers seem to be really charging ahead full steam. In addition to finding signs of extension update work being done on developer websites, #extdev on Mozilla IRC has been pretty active. I have also noticed posts on Mozillazine forums too.
I thought I’d list a few issues I have seen come up during update discussions:
event.preventBubble()has been removed in Firefox 3. It was deprecated in Firefox 2 and code should be using
event.stopPropagation(), which also works in Firefox 2.
window.addEventListener("load", myFunc, true)to listen for web content page loads does not work anymore. Changes were made to improve security and this was fallout from those changes. You should be using
gBrowser.addEventListener("load", myFunc, true)anyway. Listening for “load” events on the Firefox main window is a bit overkill. Listening for the event on the tabbed browser makes more sense and works (in Firefox 2 as well).
- The XUL popup system (
tooltip) has been significantly overhauled in Firefox 3. Some methods were deprecated (
showPopup), some were added (
openPopupAtScreen) and a whole new type of popup was added (
panel). See the new Popup Guide for more information.
There is a wiki page listing a bunch of stuff extension developers should consider or to watch when updating. If you find something, add it to the list.
One of the other benefits of updating early is the potential for helping us find Firefox bugs. We recently had an extension fail to update to Firefox 3 for no apparent reason. It was doing nothing different than when running in Firefox 2 and didn’t seem to hit any of the other know update issues.
Turns out, the extension adds a utility method to the Array prototype which worked fine in Firefox 2, but caused weird exceptions in Firefox 3. The exception ocurred in places where Firefox 3 added uses of
for each on Arrays, which is a no-no. The problem didn’t show up in any tests because Firefox 3 doesn’t add anything to the Array prototype. We are fixing this in Firefox, but it could happen to other extensions if they use
for each on Arrays. Perhaps the best advice is to always be defensive when dealing with things that could pollute the global namespace – shared by Firefox and all of its extensions.