[Project_owners] global namespace conflicts?

Philip Chee philip.chee at gmail.com
Wed Jun 7 00:34:49 EDT 2006


On Tue, 06 Jun 2006 09:19:18 +0100, Neil wrote:
> Philip Chee wrote:

>>>Each JS component has its own script global object, so they don't
>>>conflict either with each other or with DOM windows.
>>The Greasemonkey component uses mozIJSSubscriptLoader to load scripts

>>from the extension part of Greasmonkey. Why would they do it this way?

> Writing them as individual components would of course give each file a 
> separate global namespace. While it's possible to do this, it's harder 
> for the developer as the components can only be created via the 
> component manager. Nor can the components share utility functions. As an 
> aside, it also means that even if it could be made to work in SeaMonkey 
> 1.0.x it would have to be installed globally.

Yes I had to rewrite the install.js I modded for GreaseMonkey. The only
reason it was working for me with Greasemonkey installed in the profile
was that I was starting SeaMonkey with a profile switch e.g. -p default.
For some reason this worked and I never noticed the problem until
someone complained. I guess most people would start SM from the desktop
link created by the installer.

In GreaseMonkey 0.5 (when it still claimed Mozilla Suite compatibility)
the install.js would install the extension part into the profile but
register (DELAYED_CHROME) the extension in the app/global chrome.rdf.
Now, that's, well, strange. I wonder why they did it that way?

Phil
-- 
Philip Chee <philip at aleytys.pc.my>, <philip.chee at gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]Good day for flying but bad day for landings....
* TagZilla 0.059


More information about the Project_owners mailing list