Version: Smart Feature Phone 2.5

batteryManager

Description#

The BatteryManager interface provides ways to get information about the system's battery charge level.

The navigator.getBattery() method returns a battery promise that is resolved in a BatteryManager interface which you can use to interact with the Battery Status API.

Properties#

  • BatteryManager.charging read-only A Boolean value indicating whether or not 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 will suspend.

  • BatteryManager.level read-only
    A number representing the system's battery charge level scaled to a value between 0.0 and 1.0.

  • BatteryManager.health read-only Available since v2.5 The health status of battery.

  • BatteryManager.present read-only Available since v2.5 A Boolean value indicating whether or not the battery is present

  • BatteryManager.temperature read-only Available since v2.5 A number representing the temperature of battery.

Event Handlers#

Methods#

Inherited from EventTarget:

Additional methods for Mozilla chrome code#

  • void setEventHandler(DOMString type, EventHandler handler)
  • EventHandler getEventHandler(DOMString type)

Mozilla extensions for use by JS-implemented event targets to implement on* properties. See also WebIDL bindings.

Example#