[Greasemonkey] Re: addEventListener example doesn't work?

Jeremy Dunck jdunck at gmail.com
Tue Sep 20 22:49:29 EDT 2005


On 9/20/05, Bill Donnelly <donnelly at snowcrest.net> wrote:
> Some actions cause problems when executed so early
> and must be executed after onload. And I think there
> are other reasons to do it then, too. Is there any
> way to tell if we are at an after-onload state when
> our scripts execute? If not, a GM_afterLoad() function
> returning true/false would be nice if possible.

You could do something dirty like:

doc.addeventlistener('load',func() { gotload = true }...)

settimeout(function(){ if (!gotload) { //do something }}, 1000) //or
some other delay

But the point is moot if injection consistently works before load
event.  Aaron, you moved after DOMContentLoaded because that event
wasn't coming for img-only docs, right?


More information about the Greasemonkey mailing list