navigator.battery has been deprecated in favour of async getBattery method

Published: | Categories: DOM

Description

The Battery Status API implementation has been updated to match the latest spec. The navigator.battery property is now deprecated in favour of the standardized navigator.getBattery method that returns a Promise resolved in a BatteryManager instance. The battery property support will be removed in the future.

Update: navigator.battery has been removed with Firefox 50.

Update: The Battery Status API has been removed with Firefox 52.

References