Skip to content

Instantly share code, notes, and snippets.

@brianleroux
Created August 7, 2014 17:56
Show Gist options
  • Save brianleroux/cc8b4adc0f9f0b7df654 to your computer and use it in GitHub Desktop.
Save brianleroux/cc8b4adc0f9f0b7df654 to your computer and use it in GitHub Desktop.
making battery status api async http://www.w3.org/TR/battery-status/
navigator.battery.then(function(status) {
status.charging // bool
status.chargingTime // dbl
status.dischargingTime // dbl
status.level // dbl
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment