Re: Feedback about Battery Status Events

On 22.10.2011, at 5.11, ext Jonas Sicking wrote:

> Further, if we expose remaining time, the page would be able to notice
> that it's non-infinite (or whatever other value we use to signal that
> battery level won't run out).

The latest spec says:

[[

The [remaining] attribute must be set to the value positive Infinity, if the implementation is unable to report the time remaining, or there is no battery attached to the system."

]]

For example:

if (navigator.battery.remaining < Infinity) {
  // non-infinite time remaining
}

Let me know if there are concerns with this.

-Anssi

Received on Monday, 24 October 2011 07:18:35 UTC