4 ms·
I don't get why Battery Status API was dropped entirely instead being "castrated"... by default, allow clients to only detect <5%, <25%, <50%, <75%, <=100% (or
by mschuster91 9y ago
I don't get why Battery Status API was dropped entirely instead being "castrated"... by default, allow clients to only detect <5%, <25%, <50%, <75%, <=100% (or simply <25% & >25%) so that e.g. Unity or other high performance apps can say "do you really want to play Unreal Tournament with low battery".
This could also be used by ads or stuff like background monero miners to prevent killing the user's battery...
- raverbashing 9y agoYou're counting at people accessing your battery level and using it for good intentions when that's the minority of web pages Most will use it to try to push you harder "before your battery runs out"
- rqs 9y agoOr "before your battery runs out, please checkout our battery saving app"
- faebi 9y agoBuy now or you will miss it, your will be soon out of battery! App starts to drain the battery till 5%
- harsh1618 9y ago> Most will use it to try to push you harder "before your battery runs out" An example of this would be an app like Uber charging you more if your battery level is low. They already know that people with low battery are willing to pay more: https://www.forbes.com/sites/amitchowdhry/2016/05/25/uber-low-battery/ https://www.forbes.com/sites/amitchowdhry/2016/05/25/uber-lo...
- matt_kantor 9y agoThis reasoning could be extended (and maybe it should be) to remove APIs/headers allowing detection of OS/browser version (maybe Mac users are willing to pay more?), screen size (bigger monitor = more disposable income?), etc. For all of them there are tradeoffs, but it would be an interesting exercise to think about.
- Drdrdrq 9y agoThanks for an interesting link, appreciate it!
- TazeTSchnitzel 9y agoPerhaps because there isn't a clear use for it other than fingerprinting? Battery percentages don't necessarily mean much. More useful would be a power-saving flag.
- elaus 9y agoI really doubt advertisers will make their ads less resource-hungry (and therefore less noticeable/appealing) when they detect low battery levels just because it would be better for the user (albeit worse for themselves).
- dspillett 9y agoThe use case is for kiosk style applications to be able to give warnings to the user. Or for other apps to take extra precautions such as saving copies of dynamic state to non-volatile locations in case the power fails completely. Though a battery percentage is not really useful for this as it could mean many things. My current main phone at 25% could last until tomorrow quite easily, my previous main device had at most a couple of hours left at that point. A simple "warning level" API would be more useful, allowing the app to register for events like "less than one hour of power left", "power loss likely in the next ten minutes", "entering super-power-saver mode" & "manual shut-down starting" and/or poll for the same flags. That way the device, which is much better placed to monitor such properties, can manage the warning levels perhaps with an off switch in case users don't want apps to know. Of course, you might have to enforce limited resource use in response to low power events, and you shouldn't allow much time between emitting "entering super power saver" events and actually entering the mode (which will shut off browser tasks until the mode is left). So while there is a valid use case, that doesn't rely on trusting advertisers or other hogs to do something nice, the API as wasn't fit for that purpose and making something that is might be more complicated than you'd first think (so perhaps not worth the effort for the few apps that would actually make use of it).
- disconnected 9y ago> Or for other apps to take extra precautions such as saving copies of dynamic state to non-volatile locations in case the power fails completely. The system can crash, hang, forcefully reboot or otherwise die at any moment, without warning. All it takes is one "oopsy", for the phone to hit the ground and the battery to fly off. If there is important data that needs to be preserved, applications should already be committing it to non-volatile locations periodically.
- 9y ago
- hawski 9y agoI will cite myself from another thread -https://news.ycombinator.com/item?id=12862355#12863482 https://news.ycombinator.com/item?id=12862355#12863482 > There probably is not much of a difference for a website if user is low in power than if it is low in memory. There should be then just one flag/event really: low resources (catch-all for: battery, memory, CPU time, storage etc.). But browser could just emit please-save event and give a second or so to complete. Then decrease timer intervals significantly.
- jasonkostempski 9y agoEven if I have 100% battery, I don't want any of it going to ads or miners. For anything else, the OS already bugs the hell out of users when battery is low.
- mschuster91 9y agoFor me it's rather a miner than ads. Ads are obnoxious, some of them actual malware - get me rid of all the porn, viagra and tracking ads and I'll happily run a miner for you.
- mattmanser 9y agoLast site I was on with a miner I noticed as my laptop fan started going into vacuum mode. They'll just max out a core (all of them if they could). It's definitely not cool with me, an insane waste of electricity.
- mschuster91 9y agoIt does waste electricity, yes, and that's, to get back to the topic, something that a well-designed Power API could help keep in check. Still, I prefer giving a "mining" contribution to a website operator (who actually needs some kind of revenue to live) over watching obnoxious ads and having my every move end up in dozens of tracker databases, in addition to hackers distributing malware over ad networks.
- pdimitar 9y agoI prefer blocking them so bad they go out of business. If you can't pay to host your website then you don't have a viable business model and shouldn't be on the internet in the first place. I am not indebted to anyone to allow them to use my machine's resources for their monetary goals. If they want to make money off of me, make it clear -- I can respect that if I value your content. But exploiting browsers that are not caught up with latest security practices is being a scum and I will not tolerate it, ever.
- cup-of-tea 9y agoReally? It's a user's responsibility to check his own battery. You're probably the type of person who thinks a car should refuse to start without sufficient fuel. Stop it. Users are intelligent people. Let them do what they want.
- wolco 9y agoCars already refuse to start without sufficient fuel. It usually needs some.
- drzaiusapelord 9y agoEndless nags don't do end users much good. Battery status is a highly visible UI element on mobile. We don't need extra nagging from within an application. Also even less granular reporting is still an element to perform fingerprinting on. App developers should be already working on these conditions by default. You should already have a game save system that can expect client shutdown or disconnection at any time. That said, I could see a 15% or less warning but your mobile OS is doing that anyway, so why bother.
- na85 9y agoBetter to just block ads and montero entirely. Why risk it?