7 ms·
This page knows your battery charge level (unless you're using Firefox)
- Dwedit 3y agonavigator.getBattery()
- zimpenfish 3y agoDoesn't seem to work on Safari (desktop or mobile) - I just get the continuous blue animation. Chrome on macOS did report the correct battery level though.
- chipotle_coyote 3y agoYes, I think the correct headline is "This page knows your battery charge level if you're using Chrome or most Chrome-based browsers". (I'm not sure if it works on all of them, although it does work on Arc.)
- elliotec 3y agoDoesn’t work on brave.
- rpastuszak 3y agoDoes brave employ any anti fingerprinting measures?
- goryramsy 3y agoYes.
- Obscurity4340 3y agoRepresent ;)
- bonestamp2 3y agoWorks on brave for me. Any idea what setting prevents this?
- k8sToGo 3y agoNot having a battery
- andygeorge 3y agoConveniently blocks all APIs
- henriquez 3y agoCheckmate liberals
- elliotec 3y agoDo you have shields on?
- bonestamp2 3y agoYes, it says Shields are up for that page (the default until you say otherwise as far as I know). Fingerprint blocking is on. I disabled all cookies and it still works. I tried Safari and it is not working there. Pretty strange. v1.60.118
- silisili 3y agoBrave for Android here. It justs reports that it's charging and 100%, neither of which are true. No extensions or weird settings.
- rcostin2k2 3y agoNeither on Brave / Windows 11 (notebook)
- starefossen 3y agoSame here.
- hoistbypetard 3y agoIt didn't work on Safari (desktop or mobile), Brave, Librewolf or Firefox for me. It worked on Chrome and Vivaldi.
- moffkalast 3y agoOn desktop Chrome it gives me a "Charging 100%" blue animation, which I suppose is technically correct.
- jakub_g 3y agoThe API is only supported in Chromium browsers [0]. It was removed from Firefox and Safari. https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API#browser_compatibility https://developer.mozilla.org/en-US/docs/Web/API/Battery_Sta...
- zimpenfish 3y agoSomewhat disappointed in macOS for giving the information to Chrome. I'd figure that to be the kind of sensor you need a special entitlement to read (but it may well be tricky to enforce.)
- internetter 3y agoSome browsers activate a low power mode when your battery reaches a certain threshold
- zimpenfish 3y agoThat should probably come from the OS as a power management event ("low power mode: on") rather than the browser being able to read the battery state directly and making its own decisions, surely.
- internetter 3y agoProbably, yeah
- daliusd 3y agoOn iOS Safari: it looks like it does not know either
- sampli 3y agoOn iOS brave: doesn’t work
- YeahThisIsMe 3y agoI hate the internet now.
- superkuh 3y agoWith the usual qualification that you have to have your browser set to automatically execute javascript code from random untrusted websites.
- askonomm 3y agoSo ... the default settings of most browsers? The way you phrased your sentence makes it seem as if users themselves set their browser up like that, when that is not the case.
- superkuh 3y agoYup. The defaults and expectations for the commercial web are terrible. Since this is a technical forum I assume most of as aren't running our browsers that way.
- askonomm 3y agoI doubt most of us turn off javascript, and enable it on a case by case basis, regardless if it's a technical forum or not. I certainly don't. That would be a major inconvenience to do for very little benefit, imo.
- OfSanguineFire 3y ago"Most of us" probably not, but a lot of us. NoScript is one of the most popular Firefox extensions in nerd circles. Also makes a huge difference when browsing on old hardware or from a connection where data is pricey.
- LegibleCrimson 3y agoI used to (NoScript, then uMatrix for years), but it is a ton of work. Just blocking problem scripts with uBlock Origin gets you 95% of and way there. The last 5% is a lot of extra effort for seriously diminishing returns.
- 3y ago
- 7734128 3y agoCorrect on Kiwi on Android.
- hyperluz 3y agoNot working on ipad. (tested Chrome and Safari)
- Rebelgecko 3y agoDoesn't seem to work with lynx
- whynotmaybe 3y agoDdg android doesn't show it
- DiogoRolo 3y agoDoesn't work on Brave
- afavour 3y agoAs best I can tell this only works in Chrome despite the title implying Safari would be at fault. Worth pointing out though that iOS native apps appear to have this information with no permission prompt: https://stackoverflow.com/a/12346650 https://stackoverflow.com/a/12346650
- _ache_ 3y agoBasically: navigator.getBattery().then(battery => console.log(`Battery level: ${battery.level \* 100}%`)) C.f.: https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API https://developer.mozilla.org/en-US/docs/Web/API/Battery_Sta...
- rvnx 3y agoWorks as expected, the same way there are APIs for the device orientation, etc. Eventually these get placed behind permissions if they become too much widely abused. As explained in the standards: "This can be used to adjust your app's resource usage to reduce battery drain when the battery is low, or to save changes before the battery runs out in order to prevent data loss".
- cantSpellSober 3y agoI believe this is behind permissions, the Permissions-Policy directive "battery"
- kallistisoft 3y agoDoesn't respond to charging status change events even though an .onCharging call back has been set. Chromium 117.0 on Linux
- charcircuit 3y agoThis API for apps to stop being a power hog if you are at low battery or you aren't charging the device.
- mediumsmart 3y agounless not using chrome maybe
- rany_ 3y agoI'd expect this to be pitched as a way for a site to figure out whether to try to save power, but this begs the question why not just add an API to get power saving mode state?
- 1vuio0pswjnm7 3y agoDoesn't work without Javascript. Software I use to make HTTP requests does not support Javascript.
- xeckr 3y agoDoesn't work when I look at a printout of the page either.
- andygeorge 3y ago> Doesn't work without Javascript. That's fine maybe? Imo it's totally reasonable to expect end-users to have some sort of js support
- xanderlewis 3y agoI thought it was going to do something really weird and clever like use some other available measurement or input as a proxy for battery level. Like measuring CPU performance over time or temperature changes or something.
- esprehn 3y agoThis is a (very old) browser API: https://www.w3.org/TR/2014/CR-battery-status-20141209/ https://www.w3.org/TR/2014/CR-battery-status-20141209/ It was once implemented in Firefox too and then disabled outside internal pages. It's from an era of trying to standardize all the APIs needed for Firefox OS apps: https://caniuse.com/battery-status https://caniuse.com/battery-status Both iOS and Android apps have this capability, ex. https://developer.apple.com/documentation/uikit/uidevice/1620045-isbatterymonitoringenabled https://developer.apple.com/documentation/uikit/uidevice/162... Since the entropy is coarse over the entire population you could debate the privacy implications (ex. Time zone is more specific and stable). Restricting it to only saved PWAs to match the privacy model of native apps seems reasonable though. Someone should propose the change to Chrome.
- duskwuff 3y ago> ex. Time zone is more specific and stable Time zone is also much less useful for fingerprinting because it's tightly correlated with other signals like IP location and language preference. If you already know that a user's IP is somewhere in California, the additional information that they're using the Pacific time zone adds little value. (If a user's time zone doesn't agree with their geolocation, that's certainly a signal -- but it's going to be an uncommon one.)
- ec109685 3y agoFirefox and Safari obviously see the finger printing capabilities of this API and thus block.
- cantSpellSober 3y agoIt was in both since about 2012. Removed from Firefox in 2016: https://bugzilla.mozilla.org/show_bug.cgi?id=1313580 https://bugzilla.mozilla.org/show_bug.cgi?id=1313580 Removed from Webkit (Safari) soon after: https://webkit.org/tracking-prevention/ https://webkit.org/tracking-prevention/ Chrome took a middle ground, removing it for insecure origins and reducing the precision: https://chromestatus.com/feature/4878376799043584 https://chromestatus.com/feature/4878376799043584
- baz00 3y agoIt doesn't on Edge. On my desktop machine. Which doesn't have a battery.
- deleted 3y ago[deleted]
- nittanymount 3y agoexpose this without user permission ? seems an issue !
- jakub_g 3y agoFor historical context, check this paper: https://ceur-ws.org/Vol-1873/IWPE17_paper_18.pdf https://ceur-ws.org/Vol-1873/IWPE17_paper_18.pdf (page 3 has timeline of events). The API was implemented in Firefox, Safari, Chrome but it returned too precise data, so by reading battery status on two different pages and seeing the same very precise value, it was like having a tracking cookie. Firefox and Safari decided to pull the API altogether. An obvious fix while keeping the API would be to make the data less precise, i.e. round to nearest 10% or so. Still there's potential to abuse, and around the time there were news from Uber study that people with low battery could pay more for taxi, which was the nail to the coffin. Since then, there was quite a change in how new web APIs are shipped, they all come through privacy design review. Which went a bit ridiculous into the other extreme, like detecting if user uses dark mode reveals a whole one bit of information (darkmode = true | false) so it's not sent automatically, you need to ask for this info via a specific header, which means you can't know that on the first visit of the user on the website (and not on the first visit in incognito mode), only on subsequent visits. Duh. Chromium still supports the Battery API, with some rounding implemented. Note: Google's goal is to basically have all kinds of native APIs available on the web, to make the web rival with native apps, so they are very unlikely to remove things from the web in Chromium.
- ta1243 3y ago> news from Uber study that people with low battery could pay more for taxi, which was the nail to the coffin. Yet people still claim "I have nothing to hide" when it comes to concerns about privacy. When your battery level can be weaponised against you by multi-billion dollar companies, everything can be.
- charcircuit 3y agoPeople still would have to agree to the price. If it is too high they will not accept. By having more information Uber would be able to make better offers. Hiding information for financial gain, getting a better deal, is fraud.
- whstl 3y ago
- stalfosknight 3y agoOr unless you're using Safari.
- solardev 3y agoWeird, doesn't work for me on Chrome on a Pixel
- glitchc 3y agoDoesn't work on Vanadium
- binbag 3y agoIt doesn't
- iou 3y agoNeeds retitling to “Chrome and derivative browsers know your battery charging level”
- 19h 3y agoDidn’t work for me on any device using Safari with lockdown mode turned on
- unstatusthequo 3y agoDidn’t work for me with safari and no lockdown mode. I do have significant blockers on UDM Pro with NextDNS though…
- Xorakios 3y agoSo cute that some people still use cellphones.
- popcalc 3y agoOr laptops?