Battery status
Reads charge level and charging state where the browser still offers it.
In one line
Can see your battery level and charging state in Chrome and Edge
Reads charge level and charging state where the browser still offers it.
Level and times (level, charging, chargingTime, dischargingTime) once enabled short term tracking across sites. Firefox removed it; Chrome limits it to secure contexts.
What it can and can't do
What the user does: Nothing. No pop up is shown
It can
- Check your charge level and whether you are plugged in
- See time left to full or to empty
- Switch to a low power mode when your battery is low
- Use level and charge time together as a short term tracking clue
It cannot
- Work in Safari or on iPhone
- Work in Firefox, which removed it
- Work on pages that are not HTTPS
- See battery health or exact power draw
How it differs between platforms: Chrome, Edge, and Samsung Internet allow it. Firefox removed it and Safari never offered it.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 38 | 2014-10-07 | Secure context since 103 |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Removed | 52 | 2017-03-07 | Removed for web content |
| Safari | Not supported | Not available | Not listed | None |
| Safari on iPhone | Not supported | Not available | Not listed | None |
| Chrome on Android | Supported | 38 | 2014-10-08 | None |
| Samsung Internet | Supported | 3.0 | 2015-04-10 | None |
How a site asks for it
| API | navigator.getBattery() |
| Browser compat keys | api.Navigator.getBattery |
| How access is granted | none |
| What the user sees | None (no browser prompt) |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Not listed |
| How to take it back | Not listed |
| Inside an iframe | Not listed |
Typical flow
- Script reads the value
- Value joins the fingerprint payload
Data you get
What comes back: Battery status
Shape: object
How often: live events
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
level | float | fraction | 0 to 1 | 0.01 |
charging | boolean | None | Not listed | Not listed |
chargingTime | float | seconds | 0 to Infinity | 1 s |
dischargingTime | float | seconds | 0 to Infinity | 1 s |
Technical limits
- Not in Safari or Firefox
- Secure context only in Chrome
The story
What it is
Reads how full your battery is and whether you are plugged in, where the browser still allows it.
For you
You never see it asked. If it helps, a web app might lower its animations when you are low on power. If it does not, a site could quietly note that your battery is at 43 percent and charging.
For makers
Web apps use it to save power on phones and laptops. Trackers once used it as a short-lived ID, because level and charge time are the same across sites for a few minutes. That is why Firefox and Safari removed it and Chrome limits it.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A web game drops from 60 to 30 frames a second when the phone is under 15 percent and not charging. | None named |
| video | A streaming site starts at a lower resolution on a laptop that is unplugged and nearly flat. | YouTube |
| productivity | A browser notes app forces an immediate save when it sees the battery is almost out. | Google Docs |
| maps | A web map in navigation mode shows a plug-in reminder when the phone is low on charge. | Google Maps |
| security | A fingerprinting script uses level and charge time as a short-term ID to link two visits in the same hour. | None named |
| shopping | Researchers warned that a shop could change a price for a person who looks desperate for power; this is a risk, not a known practice. | None named |
Risks
- Short-term tracking ID
- Could hint at someone's situation
What the platform says
- MDN: Battery Status API. Describes how a page reads charge level and charging state where browsers support it.
Good uses and abuse
Legitimate uses
- Save power
Known abuse
- Short term cross-site tracking
- Device ID
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 3 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 3 | Rough identifying entropy, when known |
A real example: LinkedIn
Collector key(s): battery. Collects level, charging, chargingTime, dischargingTime. BleepingComputer confirms battery is collected.
History
- 2017, Firefox 52: Removed for web content over fingerprinting
Related capabilities
Related
- APFC / DNA device fingerprint (abuse prevention features). Can collect about 48 device traits and send them in secret with later requests
Sources
- MDN Battery Status
- BleepingComputer: LinkedIn scans for 6,000+ Chrome extensions
- mdp/linkedin-extension-fingerprinting (LinkedIn script snapshot and ID list)
How well checked: Based on official documentation.