navigator.getBattery().then(function(a) {console.log(a);})
https://developer.mozilla.org/en/docs/Web/API/Battery_Status... navigator.getBattery().then(function(a) {console.log(a);})
https://developer.mozilla.org/en/docs/Web/API/Battery_Status...This lets sites who want to do "real things" with battery levels have access, without it being available "for free" (prompt is annoying).
My guess is this is just another part of the attempt to move desktop features to the web browsers so that people don't have to write actual applications. Personally, I don't like this trend.
For the ideologically inclined, it’s also about disintermediating the relationship between users and developers. Web sites don’t need an app store.
> “Some companies may be analysing the possibility of monetising the access to battery levels,” he writes. “When battery is running low, people might be prone to some – otherwise different – decisions. In such circumstances, users will agree to pay more for a service.”
That describes a scarily large portion of all web stuff.
Web applications served over HTTP, on the other hand...
Mozilla have it as part of their mission to make technology open and accessible (insert DRM debate here). Native apps have been thrown behind the app store “walled garden.” So, they want to make it possible to create rich apps over HTTP.
Thus, you find things like this available to web pages.