I am making a chrome extension for personal use that will recursively call setTimeout. I would like to make sure that under no circumstances does this extension accidentally produce multiple chains of setTimeouts.
I have made it so that when I click the browser action it calls clearTimeout. However, I worry about when I reload the extension could the old chain of timeouts continue? And there may be other scenarios I am not thinking of. Is there a tried and true method to prevent accidentally creating multiple chains of timeouts?
It looks like there is no way to enumerate active javascript timers:Viewing all the timouts/intervals in javascript?