Expose information about repeating timers




9 years ago
4 months ago


(Reporter: bzbarsky, Unassigned)


(Blocks: 1 bug)

Mac OS X

Firefox Tracking Flags

(Not tracked)


It might be good to be able to ask Firefox a question like "which web pages are doing repeating timers, and what's the delay on them?"  Specifically, this would list interval timers and timeout timers with a nesting level above a certain depth (say 100).  We could do this by enumerating all the windows and then for each window inspecting its timeout list.

The goal would be to try and understand which web pages might be sucking up CPU while the browser is supposedly idle.

John, would Firebug be interested in this sort of information on a per-window basis?


9 years ago
Blocks: 532903

Comment 1

9 years ago
The comment 0 proposal won't catch a page that repeatedly sets timeouts off an interval timer, necessarily.  We could track the nesting level for intervals too, so said timeouts would get that nesting level.

Comment 2

9 years ago
(In reply to comment #0)
> John, would Firebug be interested in this sort of information on a per-window
> basis?

Yes, Firebug very much wants to know similar information but I'd put the question differently. For a given window (JS program) we want to know all of the setTimeout and setInterval calls pending with the ability to debug them.

If the goal is simply to determine JS execution time however I think we can do that with jsd's topLevelHook.

Comment 3

9 years ago
The goal is to answer the following question: "Which tabs should I close so that my browser stops draining my battery?"

Comment 4

9 years ago
At least that's my goal; I just figured Firebug might be interested in similar information so we might as well gather requirements from you guys when deciding  the API to expose here...

From a web developer's point of view, the question might be "what timers on my page make it slow?"
I think if we expose a list of timers and/or intervals we should just expose them all, and let the consumer of this API filter out ones that repeat slower than x or what not. Seems like an API worth adding.

Comment 6

9 years ago
Sure, if we expose the repeat and nesting values the consumer could just handle it.

Comment 7

9 years ago
So just hang this off windowutils?
Yeah, I think that'd be the best place for it.

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.