Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How much can websites determine about the power of the device they're running on? Obviously it'd be a security issue for them to know too much, but it would be nice to be able to progressively enhance the experience for more powerful devices that can handle it, beyond just mobile vs PC. Even just knowing whether a device was running off battery power could be useful.


Here's what's available, requires permissions:

- BatteryManager.charging

- BatteryManager.chargingTime

- BatteryManager.dischargingTime

- BatteryManager.level

https://developer.mozilla.org/en-US/docs/Web/API/BatteryMana...

https://caniuse.com/?search=BatteryManager


Isn't available in Firefox though...


I don't think you really want websites to make this determination anyway. There are a million reasons why a user might want a website to use fewer resources than their machine could support.

It should just be a setting the user can select. No probing of the machine necessary.


What should be a setting? This specific youtube ambience thing? That is, but it shows the issue - you need to pick a default, and most people won't know they can change it. Having some idea of the capabilities of the device you're running on could allow you to choose sensible defaults.

But if you mean there should be a setting in the browser that websites could check, I agree that could be better.


Sensible defaults go a long way, yes! Although in the case of this YouTube thing, I think the sensible default is to have it disabled regardless of the capabilities of the machine.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: