BatteryManager.charging

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Um valor Booleano que indica se a bateria está sendo ou não carregada no momento.

Sintaxe

var charging = navigator.battery.charging

No retorno, charging indica se a bateria está sendo carregada no momento; se a bateria está carregando (ou se não há bateria), este valor é true. Caso contrário, o valor é false.

Especificações

Specification
Battery Status API
# dom-batterymanager-charging

Compatibilidade com navegadores

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
charging

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

Veja também