I've read:
Determine if window is active in webkit
and tried the demo at:
http://www.thefutureoftheweb.com/demo/2007-05-16-detect-browser-window-focus/
But that works on focus, and focus can be lost to another window, while the page is still visible (if the other window is not maximised).
What I'm looking for is a value which is true when the page is visible and false when it is not (or events on the transitions).
Edit: I suppose what I'm essentially looking for is "is this browser messing with my setIntervals and setTimeouts".
Edit: It looks like this is being sorted out: https://developer.mozilla.org/en/API/PageVisibility/Page_Visibility_API