[Greasemonkey] insertBefore(document.body) glitch

Joe la Poutre jsixpack at gmail.com
Tue Jul 12 23:58:29 EDT 2005


Just for the record: I'm seeing the same behavior with GM 0.3.4 and
the following code:

var ol = document.createElement('ol');
// append child stuff removed...
document.getElementsByTagName("body")[0].appendChild(ol);

This is solved by calling the appendChild line from a timeout:

setTimeout(function() { // stuff removed...
document.getElementsByTagName("body")[0].appendChild(ol);
 }, 1000);

Anyway, this solution looks like a kludge to me.


More information about the Greasemonkey mailing list