Skip to Content
Platform.Ontology

Battery Status API and drain inference

Reads battery level, charging state and time estimates in Chromium browsers.

Gets silentlySpeed and timingPowerWeb browsersWhen the page loads

In one line

Can see your battery level and charging state in Chromium browsers

Reads battery level, charging state and time estimates in Chromium browsers.

Level and discharge time can short-term link visits across sites. Remaining time infers device load. Removed from Firefox and never added to Safari because of the tracking risk.

What it can and can't do

What the user does: Nothing. It happens when the page loads, or when a page checks power use

It can

  • Check your battery level and if you are charging
  • Check how long until it is full or empty
  • Use short lived numbers to link two visits close together

It cannot

  • Get battery info in Firefox, which removed it, or in Safari, which never added it
  • Ask permission first
  • Know who you are by itself
  • Tell what apps you run

How it differs between platforms: Chrome, Edge and Samsung Internet allow it. Firefox removed it and Safari never added it because of tracking worries.

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported382014-10-07Secure contexts only since 103
EdgeSupported792020-01-15Secure contexts only since 103
FirefoxRemoved522017-03-07Removed in 52 (2017)
SafariNot supportedNot availableNot listedNone
Safari on iPhoneNot supportedNot availableNot listedNone
Chrome on AndroidSupported382014-10-08Secure contexts only since 103
Samsung InternetSupported3.02015-04-10Secure contexts only since 103

How a site asks for it

APInavigator.getBattery(); BatteryManager level, charging, chargingTime, dischargingTime
Permissions policybattery
Browser compat keysapi.Navigator.getBattery
How access is grantednone
What the user seesNot listed
Needs a secure context (HTTPS)Yes
Needs a user gestureNo
How long it lastsNot listed
How to take it backNot listed
Inside an iframeNot listed

Typical flow

  1. Call getBattery (secure context)
  2. Read BatteryManager fields and events

Data you get

What comes back: 4 fields
Shape: object

FieldTypeUnitRangePrecision
levelfloatfraction0 to 11% steps (bucketed to 1% on Chrome)
chargingbooleanNonetrue or falseexact
dischargingTimefloats0 to Infinity15 minute rounding

Technical limits

  • Cannot read battery on iOS or Firefox
  • Can't see battery health, only level

The story

What it is

A page reads your battery level, whether you are charging and time left. Only some browsers allow it.

For you

You get no prompt. A page might switch to a lighter mode or pause fancy effects when your battery is low. Researchers showed it could be used to track people, so Firefox and Safari left it out.

For makers

Makers use it to save power and avoid draining a phone in the middle of a game or video. It also works as a small device signal, which is why privacy minded browsers removed it.

Where you see it

TypeExampleApps
gamesA browser game lowers the frame rate and effects when you are under 20 percent battery.None named
videoA streaming site picks a lower resolution on low battery to let you finish the movie.YouTube
videoA video call tool turns off background blur when your laptop is unplugged and low.Google Meet
productivityA web editor saves your work sooner when battery is about to die.None named
adsA tracker combines battery level and time to charge as a short lived device ID.None named
shoppingPrivacy researchers warned that a shop could change prices for people with a low battery, which is one reason the feature was removed.None named
fitnessA web workout player skips heavy animations on a phone that is almost out of power.None named

Risks

  • Can be used for tracking
  • Removed from Firefox and Safari

What the platform says

  • MDN: Battery Status API. Lets a page see the device's battery level and charging state, so it can save power when low.

Good uses and abuse

Legitimate uses

  • Low-power modes for apps

Known abuse

  • Short-term device linking (Olejnik 2015), retail price discrimination claims

Scores

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility2 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits3Rough identifying entropy, when known

History

  • 2016-10, Firefox 52: Battery API removed over privacy concerns
  • 2022-08, Chrome 103: Restricted to secure contexts and permissions policy battery

Sources

How well checked: Based on official documentation.

On this page