This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The BatteryManager interface of the Battery Status API provides information about the system's battery charge level. The navigator.getBattery() method returns a promise that resolves with a BatteryManager interface.
Since Chrome 103, the BatteryManager interface of Battery Status API only expose to secure context.
Also inherits properties from its parent interface, EventTarget.
BatteryManager.charging Read only
A Boolean value indicating whether the battery is currently being charged.
BatteryManager.chargingTime Read only
A number representing the remaining time in seconds until the battery is fully charged, or 0 if the battery is already fully charged.
BatteryManager.dischargingTime Read only
A number representing the remaining time in seconds until the battery is completely discharged and the system suspends.
BatteryManager.level Read only
A number representing the system's battery charge level scaled to a value between 0.0 and 1.0.
Also inherits methods from its parent interface, EventTarget.
Also inherits events from its parent interface, EventTarget.
chargingchangeFired when the battery charging state (the charging property) is updated.
chargingtimechangeFired when the battery charging time (the chargingTime property) is updated.
dischargingtimechangeFired when the battery discharging time (the dischargingTime property) is updated.
levelchangeFired when the battery level (the level property) is updated.
| Specification |
|---|
| Battery Status API> # the-batterymanager-interface> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
BatteryManager |
38 | 79 | 43–52 | 25 | No | 38 | 43–52 | 25 | No | 3.0 | 38 | No |
charging |
38 | 79 | 43–52 | 25 | No | 38 | 43–52 | 25 | No | 3.0 | 38 | No |
chargingTime |
38 | 79 | 43–52 | 25 | No | 4238–42Always equal to0 or Infinity. |
43–52 | 2925–29Always equal to0 or Infinity. |
No | 4.03.0–4.0Always equal to0 or Infinity. |
4238–42Always equal to0 or Infinity. |
No |
chargingchange_event |
38 | 79 | 43–52 | 25 | No | 38 | 43–52 | 25 | No | 3.0 | 38 | No |
chargingtimechange_event |
38 | 79 | 43–52 | 25 | No | 38 | 43–52 | 25 | No | 3.0 | 38 | No |
dischargingTime |
38 | 79 | 43–52 | 25 | No | 4238–42Always equal toInfinity. |
43–52 | 2925–29Always equal toInfinity. |
No | 4.03.0–4.0Always equal toInfinity. |
4238–42Always equal toInfinity. |
No |
dischargingtimechange_event |
38 | 79 | 43–52 | 25 | No | 38 | 43–52 | 25 | No | 3.0 | 38 | No |
level |
38 | 79 | 43–52 | 25 | No | 38 | 43–52 | 25 | No | 3.0 | 38 | No |
levelchange_event |
38 | 79 | 43–52 | 25 | No | 38 | 43–52 | 25 | No | 3.0 | 38 | No |
secure_context_required |
103 | 103 | No | No | No | 103 | No | 71 | No | 20.0 | 103 | No |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager