[Greasemonkey] Weirdness with window.setTimeout and Gmail

Tom Tobin korpios at gmail.com
Wed Feb 1 07:49:55 EST 2006


Since the DOMSubtreeModified event in Firefox isn't reliable, I've
been using window.setTimeout and an infinite loop with a 200 ms delay
to have a userscript of mine work properly (as it modifies the order
and layout of the label list, and I want to make sure it's always
sorted).

The script seems to work perfectly . . . until I come back to Gmail
after leaving it for a few hours, at which point it becomes unusable
(i.e., it's completely blank or nothing responds) and I have to log
back in.  If I disable the loop, this never happens -- but the label
sorting only happens on instances that Gmail reloads the subdocument
for the label list.

Anyone have any idea what's going on here?  Is there any trick to
getting such loops to "behave" with Gmail that I'm missing?


More information about the Greasemonkey mailing list