HTML5: Access Battery status through javascript
smartjava.org
smartjava.org
Someone clever could use this misfeature (what amounts to a data leak) to perform a sort of traffic analysis attack and infer data about your sleeping/working/browsing schedule, and then potentially interpolate travel patterns, business associations, and maybe even correlate to a precise (historical) physical location.
The security implications here are vast (and not immediately obvious), and there is a vanishingly small practical use case for this.
Why does this exist?
"can" != "should", for fuck's sake.
Given the other things available to a dev wanting to know about a user's behavior, battery status is a strange one to rant about.
> The security implications are vast.
No they're not. Battery status has been available to every app on your laptop for years without a problem. Web pages are ad hoc apps. If you're concerned, don't install the app, and use NoScript with a whitelist for browsing.
I wouldn't say that this is the same as giving battery status to every app on your laptop. A closer example might be smart phones. But there's a presumption that if software is running on your laptop or smartphone you have at least some idea of what it is and what it can do. In practice not so much and such apps could misuse this data along with others.
Worked perfectly on my laptop, in Firefox 13.