Obsolete since Gecko 50 (Firefox 50 / Thunderbird 50 / SeaMonkey 2.47)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
battery read-only property returns a
BatteryManager provides information about the system's battery charge level; provides also some new events you can handle to monitor the battery status. This implements the Battery Status API; see that documentation for additional details, a guide to using the API, and sample code.
var battery = navigator.battery;