← Back to context

Comment by Nursie

5 years ago

The page visibility API should be on the list.

It's none of your business if I'm looking at your page or not.

So if a page is running a computation in the background, for example, rendering some real time chart or something, you'd rather it continue to do work and waste battery life, then to throttle itself?

But then you'll say "well the browser should just throttle any tab i'm not looking at" (which it already does), but then you'll complain the first time an app you actually want live updating doesn't work properly.

  • > So if a page is running a computation in the background, for example, rendering some real time chart or something, you'd rather it continue to do work and waste battery life, then to throttle itself?

    Yep, that's the behaviour I expect. If I want you to stop I'll close you.

    > But then you'll say "well the browser should just throttle any tab i'm not looking at"

    Why would I say that? I explicitly don't want pages to act differently when I'm not looking at them. If they're updating when I'm looking at them then they should keep doing that when I flick away to something else.

    It's a privacy issue and it's a functionality issue. It's literally none of the page's business whether I have it in view or not.

    Next you'll be telling me that pages should be able to use the camera and face sensing tech in smartphones to detect if I'm looking in the right direction. For my convenience of course, nothing to do with advertising, tracking, analytics...

    FYI I've managed to find an addon for firefox that blocks this API. No noticeable difference in battery life.

    • > Next you'll be telling me that pages should be able to use the camera

      They already do have access to the camera through the getUserMedia APIs, and WebXR has Gaze Tracking. Even your iPhone allows camera access through the Web.

      3 replies →