[Greasemonkey] Script scoping

Scott R. Turner srt at aero.org
Tue May 3 12:11:10 EDT 2005


On Tue, 3 May 2005, Jeremy Dunck wrote:
>> I'm facing many of these issues in building the GM scripting extension.
>> One approach is to hook any script using another script to onload; I think
>> that guarantees the other script will be fully loaded.
>
> Yeah it does, but only works to one level of dependency.

I'm not sure what you mean here.  By the time onload occurs, all other
scripts ought to be loaded and their functions available.  In
particular, if you want to get functions from a "library" script, then
they ought to be available.

I think more of a problem is ensuring that your library script gets
loaded into all the pages that use any script that uses the library
script.  How do you manage that?

 	     -- Scott


More information about the Greasemonkey mailing list