3 ms·
As someone building a cross-platform battery monitor that depends on APIs like this being available, I think the best solution would be to treat battery status
by gbl08ma 10y ago
As someone building a cross-platform battery monitor that depends on APIs like this being available, I think the best solution would be to treat battery status like the location information, where the user is asked on a case-by-case basis whether to provide the information.
You might argue that this sort of stuff should only be available to native applications, that browsers should not attempt to replace native apps or even recreate an OS within themselves (something Chrome is often criticized for). The thing is, my battery monitor has native apps and yet users have been asking for web-based clients, be it browser extensions or plain web pages. And with some platforms loading a website or installing an extension has much less friction than installing a native app.
Sure, extensions can have access to a lot of stuff webpages don't have. But I would rather use standardized APIs that work across all browsers and are well documented in more than one website, than have to rewrite my extension for each browser and not have it work on plain old pages.
If the battery API was made to work like the location one I think everyone would be happy - users are informed and in control, developers can still offer features based on it, and it raises red flags when it needs to ("why is this advert asking about my battery status?").