Re: Proposal for a page visibility API

On Thu, Jan 20, 2011 at 4:24 PM, Drew Wilson <> wrote:
> In the latter case, I actually don't think your current definition of
> visible ("is the focused tab in some browser window somewhere, even if
> window is completely obscured by other windows") adequately addresses that
> use case (either the page would just hook focus/blur(), or it would really
> want to know if its actually visible to the user, rather than just being
> topmost tab in a completely obscured window.

It permits treating obscured windows as visible, since detecting a fully
obscured window in every possible case may be difficult, but browsers should
be strongly encouraged to treat obscured windows as hidden whenever

There's a big difference between a window maximized on my secondary monitor
but not focused, and a window in a background tab that's not visible at all.

On Wed, Jan 19, 2011 at 9:22 PM, Alex Komoroske <>
> Use cases

Some other use cases:

- A page that's rendering animations (whether cosmetically, or for a game)
can suspend them, and any related timers, to save resources if it's not
- If a page is playing a video and filtering video pixel data through a
worker (eg. to apply a gamma curve), it can suspend the possibly expensive
filter while it's not visible.
- If a page is playing a video with no audio, it can pause the video when
it's not visible.  (You probably don't want to do this with video containing
audio, though that's also possible.)

(In principle, a live video stream with audio and video could suspend the
video part of the stream when not visible, to save a significant amount of
bandwidth, but of course that would need protocol and API support that may
never exist.)

Glenn Maynard

Received on Thursday, 20 January 2011 23:33:49 UTC