Getting the OpenURL Referrer to work
I worked with Thomas Ventimiglia of
Openly Informatics, Inc. to debug Openly's
Openly's OpenURL Referrer, a FireFoxBrowser/BrowserExtensions for inserting OpenURLs into GoogleScholar search results. Our consultation resulted in Tom's tracking down and implementing
two bug fixes:
1.0.8 (1/28/05):
* Fixed bug involving Empty Profile Name Box/Error when creating new profile
1.0.9 (2/3/05):
* Fixed bug involving namespace conflicts with other FF Extensions
Special thanks to Raymond Yee and Richard Silverstein for helping us identify this elusive bug!
The basic problem was that the OpenURL extension was conflicting with another extension that I had previously installed (
copyurlplus, to be exact). The initialization routines for both extensions were named the same. So apparently, because copyurlplus had been installed first, the OpenURL extension ended up calling the initialization routine of copyrurlplus!
The workaround, in Tom's words: "The solution was to package all of our functions and global variables in a uniquely-named object that would not collide with anything in another extension's namespace." He then pointed me to
Coding For Portability, Part 1 » Thirteenth Parallel for further explanation.
I had been wondering about the interaction model among extensions, and had naively thought that extensions would have their own namespaces and that there was a very well-controlled model of interaction. This bug that Tom and I worked on shows that I was wrong.
Should we be concerned? I think so. Now that we have had a taste for this problem, a quick google search on "firefox extension namespace" shows that at least one other person has run into the same issue: Mark Bokil reports at
Microsoft's Peter Torr Attacks Mozilla Firefox Security - MozillaZine Talkback:
-
I feel there are some serious design issues with the way extensions are currently implemented. I came across some problems while writting two extensions so here are my observations of the current extension development method:
[....] The problem I see with this ad hoc method is design standards. While writting extensions I ran into problems where I would create a global variable or name an extension method a certain name and my extension would stop working. After some head scratching I figured out that the main content window and my extension variables were all in the same namespace or scope.
[....] What I started to do was to wrap my extension in a Javascript object and then refer to my variables and methods using my domain name to create a unique memory namespace. So my variables look like markbokil-org.settingOne or methods look like markbokil-org.getMenuxOptionsPanel().
Possibly Ben Goodger could add to this discussion or a rep. from mozilla.org could chime in here for a community discussion in the forums.
No answer yet.
