[Project_owners] setInterval and tabs
Eric H. Jung
eric.jung at yahoo.com
Tue Nov 20 18:59:05 PST 2007
--- Marco Pivetta <ocramius at gmail.com> wrote:
> Hi everybody,
> I've just added a window.setInterval([...something...]) to my extension's
> javascript code.
> I am having problems with the scope of the extension.
> Every time I open a new tab the event listener "moves" from the old tab to
> the new one.
> This results in a chaos of intervals that get overlapped and literally EAT
> the CPU load.
> This because I load window.setInterval([...something...]) instead of
> SOMETHING.setInterval([...something...]), where SOMETHING should be an
> element related with the webpage tab.
> Any ideas? How do I get the tab element? I've browsed half of the MDC wiki
> without finding how to limit a setInterval to a single tab.
> I've tried with many elements, but none of them seems to have the method
> setInterval.
> Thank you for any help
Would using nsITimer instead of setInterval() help?
http://www.xulplanet.com/references/xpcomref/ifaces/nsITimer.html
More information about the Project_owners
mailing list