Browser Battery Status Api Tester
Fast, accurate and free online browser battery status api tester tool running directly in your browser.
-
1Enter data
Enter content, paste text or load a file from disk. -
2Click the button
The tool will immediately process your data in the browser. -
3Get the result
Copy the finished text or save the file to your device.
return "Result ready in 0.1s";
}
Rate this tool:
Related tools
Other tools you may find usefulBattery Status API - testing browser battery support
Battery Status API (W3C) allows web applications to read a device's battery level via JavaScript. The tool tests whether your browser provides this data and displays current information: charge level, charging status, time until fully charged or discharged.
What is Battery Status API
Battery Status API (W3C specification) provides a JavaScript API: navigator.getBattery() returns Promise with an object BatteryManager. Properties: battery.level (0.0–1.0, charge level), battery.charging (boolean, whether it is charging), battery.chargingTime (seconds to full), battery.dischargingTime (seconds to discharge). Events: chargingchange, chargingtimechange, dischargingtimechange, levelchange.
Browser support
Chrome: Supported (Desktop and Android). Firefox: removed in v52+ (privacy – fingerprinting). Safari: not supported. Edge: Supported (Chromium-based). Opera: supported. Note: Many browsers intentionally limit or remove the API for privacy reasons (the battery may have been used for user fingerprinting).
JavaScript code example
navigator.getBattery().then(battery => { console.log(battery.level*100 + "%"); console.log(battery.charging ? "Charging" : "Battery"); console.log(battery.chargingTime + " s to full"); battery.addEventListener("levelchange", () => { console.log("Change:", battery.level });
Uses of Battery API
PWA (Progressive Web App): adjust low battery behavior (reduce polling, disconnect WebSocket). Web games: power saving mode. Analytics: check if users with low battery have a higher bounce rate. Notifications: "Battery low - save your work." Monitoring: alert user at < 20%.
FAQ
Why did Firefox remove the Battery Status API?
In 2015, researchers (Olejnik et al.) showed that battery.level + battery.chargingTime + battery.dischargingTime = unique fingerprint of the device with an efficiency of ~67%. This allowed trackers to track users even after clearing cookies. Firefox removed the API in v52 (2017). Safari never implemented it. This is one of the few cases where an accepted standard has been removed for privacy reasons.
How to check battery level in Node.js?
Battery Status API only works in the browser. In Node.js: systeminformation (npm) – si.battery() returns hasBattery, percent, isCharging, timeRemaining. PowerShell (Windows): Get-WmiObject Win32_Battery. Linux: cat /sys/class/power_supply/BAT0/capacity. macOS: pmset -g batt.
Does Battery API work on the phone?
Android Chrome: Supported (physical battery). Android Firefox: removed. iOS Safari: not supported. PWA for Android with Chrome: battery access possible. Ionic/Cordova: cordova-plugin-battery-status plugin (works on iOS and Android).
How to simulate low battery in DevTools?
Chrome DevTools: Sensors tab (Cmd+Shift+P → "Sensors"). In the Battery section: mock battery level, charging state, charging/discharging time. Useful for testing PWAs with battery-aware logic. Firefox: no battery simulator (API removed).
What other APIs may violate privacy?
Fingerprinting APIs: Canvas (unique GPU rendering), WebGL (renderer, vendor), AudioContext (AudioWorklet timing), Screen Resolution, Timezone, Language, Plugin list. Battery API was in this group. Privacy Sandbox (Google): an attempt to limit fingerprinting while maintaining advertising function