http://www.theguardian.com/technology/2015/aug/03/privacy-smartphones-battery-life I tried test code on FF39, and was able to access battery charge info/events via the Battery API when dom.battery.enabled == true. Which is the default I believe.
they seem to come from the perspective that its ok to collect any info from the user unless there is very good reason to deny instead of the other way around. its the $$$$
Good thing I don't have a Smartphone And when I do have one I'll make sure it has a good OS and hardware. Don't know when that will happen, though.
It looks like you can disable it on Firefox(desktop) by setting dom.battery.enabled to False. It's a HTML5 spec, so it probably also works on notebooks.
Yes, it works on other types of devices too. I ran my test code on a notebook. I found an online test page if you want to test your browser/device combo: https://pazguille.github.io/demo-battery-api/ Due to update interval, and perhaps some other aspects, the dischargingTime and chargingTime information available via the API may be delayed/quirky. That test page will reflect such things. You'll have to enable Javascript in order for the test page to manipulate the battery API. Disable afterwards as you see fit.