Who knew. Apparently, websites can collect pretty detailed information about the battery of the laptop or smartphone you’re using. They can see if you’re currently charging the battery. If you are, they can see how long it’ll take before it’s fully charged. If you aren’t, they can see how long it’ll last.
I read about this in the Guardian, which has an article about a study that apparently found that the detailed information obtained through the HTML5 battery status API can in some cases be used to identify users, at least over a short period, even if they use a VPN or Chrome’s private browsing mode.
However, the API doesn’t work in all browsers. In fact, I googled around to find out how it works and it turns out you need different code to get it working in Firefox than in Chrome. And while I got the code working on my Macbook, it didn’t work on my iPhone - not even with Chrome.
So how about your device? You can check below if the code works with your combination of browser and device. Let me know!