I'm writing a webapp that performs an action every minute or so which (very briefly) hangs the browser. I'd like to pause this action when the tab displaying the webapp is not shown, to minimize the annoyance. Is there any way to do this using Javascript, under the latest version of Firefox?
Edit: to clarify, I'm asking about how to determine the visibility of the tab that some JS code is running in - not how to pause/resume the action which hangs the browser.