[Greasemonkey] Execution Order - q on addEvenListener

Aaron Boodman zboogs at gmail.com
Tue Aug 16 09:50:09 EDT 2005


On 8/16/05, Chris Hayes <chayes at antenna.nl> wrote:
> 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
it. You are making it way more difficult than it needs to be:

function getBannedUsers() { /* blah */ }
window.addEventListener("load", getBannedUsers, true);

End of story. 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?

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.

-- 
Aaron


More information about the Greasemonkey mailing list