A nice look into the up and coming battery api. This could be useful in the future to help keep users on your website while there phones are nearly dying.
For example turning off websockets in favour of a manual poll to the server could save battery life and this could be based off a less than a specified amount battery charge.
The more demanding our web apps become, the more power we draw from devices. On desktop, where we can be sure that the device is plugged into the mains, that’s not a problem, but on a mobile device we need to know what the battery is doing and respond accordingly.