[Greasemonkey] addEventListener,
DOMNodeInserted event in GM user script
Lenny Domnitser
ldrhcp at gmail.com
Tue Mar 7 09:35:01 EST 2006
On 3/7/06, Brian Donovan <bdonovan at gmail.com> wrote:
> Given:
>
> document.addEventListener('DOMNodeInserted',function(){alert('DOMNodeInserted
> !');},true);
> window.addEventListener('load',function(){alert('load !');},true);
>
> Why is it that both of the following alerts will pop up in Firefox
> when the following lines are placed within a script tag within a page
> but only the latter (for the window.onload event) will pop when those
> lines are present in a GM user script?
DOMNodeInserted fires when a child node is inserted. For document,
that would be when the <html> element is inserted. I would presume
that the element is inserted before DOMLoaded for HTML (not XHTML)
pages, which allow progressive loading.
This is my best guess, unverified.
More information about the Greasemonkey
mailing list