[Greasemonkey] Execution Order - q on addEvenListener

Chris Hayes chayes at antenna.nl
Tue Aug 16 23:04:00 EDT 2005

Aaron Boodman ranted at Chris Hayes:

>> window._x_getBannedUsers=function()
>>  {    alert('in function');
>>   return;
>>  }
>Stop doing this! Stop! Stop! Stop! It no longer works in Greasemonkey
>0.5 because you cannot add arbitrary properties to DOM objects. But
>beside that, it is totally silly. You don't need it. You don't want
Actually, I do - <--see, I am trying my best to be civilized.

>You are making it way more difficult than it needs to be:
>function getBannedUsers() { /* blah */ }
>window.addEventListener("load", getBannedUsers, true);
>End of story. 

The reason to add a function the way i did is because I needed to call 
some functions from links I added to a forum: so I cannot call a 
function that's within the GM scope.

I first added the js functions to the page as a script tag but the DOM 
you-seem-to-hate-so-much-and-i-am-really-sorry-bothering-you-witht saved 
me from juggling with single and double quotes. And as a result it 
looked so much cleaner, and clean looking code is so much easier to 
maintain.  And.... it used to work in GM 0.3.

And actually it STILL seems to work, see user script at 
http://www.hieris.info/about/GMproblem2.html,  once the ()'s were 
removed. I may have made a mistake but I cannot get your suggested code 
to work, while the other two ways seem to work.

>This is in every single online reference to the DOM.
>It's in every Mozilla DOM reference. Who is making up this wacky
>window.foo = blah stuff?
This method was advised on this very list on June 8, by Anthony 
Lieuallen, at 16:23. It also was mentioned in another thread, in July, a 
thread you joined in - but i did not see you object to it.

>I think I may need to write a http://youngpup.net/2003/popups -style
>rant about this. Whoever started this meme needs to be shot.

More information about the Greasemonkey mailing list