[Greasemonkey] GM-TNG - several bugs fixed

Bill Donnelly donnelly at snowcrest.net
Thu Jul 28 02:08:45 EDT 2005


So, when you perform the following INSIDE your script:

    function foo() {
    ...
    }

    button.onclick = foo;

Then JS 'magically' knows that the reference to foo()
is the locally defined foo function, which is in the
script "sandbox" context that Gm now defines for our
scripts to run in, right?  (this is an actual question)

So when the button click occurs outside of our scripts in
the browser window global context, JS will automatically
call the correct funtion in the sandbox, and it will
execute in the GmScript context?

I'm not sure why I was confused. Although, having to
think about (multiple) "contexts" is an added newish thing
for JS that we never had to think about before back
in the Good Ol' Daze.

-- 
Jack the Ripper may have been quite insane,
but he had beautiful penmanship.
btw -- Don't look back!
The lemmings are gaining on you.


More information about the Greasemonkey mailing list