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.