Skip to Content
Platform.Ontology

Battery status

Reads charge level and charging state where the browser still offers it.

Gets silentlyDevice detailsHardwareWeb browsersWhen the page loadsWhile you use 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

BrowserStatusFirst versionReleasedNote
ChromeSupported382014-10-07Secure context since 103
EdgeSupported792020-01-15None
FirefoxRemoved522017-03-07Removed for web content
SafariNot supportedNot availableNot listedNone
Safari on iPhoneNot supportedNot availableNot listedNone
Chrome on AndroidSupported382014-10-08None
Samsung InternetSupported3.02015-04-10None

How a site asks for it

APInavigator.getBattery()
Browser compat keysapi.Navigator.getBattery
How access is grantednone
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsNot listed
How to take it backNot listed
Inside an iframeNot listed

Typical flow

  1. Script reads the value
  2. Value joins the fingerprint payload

Data you get

What comes back: Battery status
Shape: object
How often: live events

FieldTypeUnitRangePrecision
levelfloatfraction0 to 10.01
chargingbooleanNoneNot listedNot listed
chargingTimefloatseconds0 to Infinity1 s
dischargingTimefloatseconds0 to Infinity1 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

TypeExampleApps
gamesA web game drops from 60 to 30 frames a second when the phone is under 15 percent and not charging.None named
videoA streaming site starts at a lower resolution on a laptop that is unplugged and nearly flat.YouTube
productivityA browser notes app forces an immediate save when it sees the battery is almost out.Google Docs
mapsA web map in navigation mode shows a plug-in reminder when the phone is low on charge.Google Maps
securityA fingerprinting script uses level and charge time as a short-term ID to link two visits in the same hour.None named
shoppingResearchers 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

Good uses and abuse

Legitimate uses

  • Save power

Known abuse

  • Short term cross-site tracking
  • Device ID

Scores

ScoreValueMeaning
Sensitivity3 of 5How revealing the data is
Utility3 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits3Rough 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

Sources

How well checked: Based on official documentation.

On this page