4 ms·
E.g. weather app that automatically fetches new weather data periodically, but stops when battery is low. That said, you're right that the only data you need fo
by brlewis 10y ago
E.g. weather app that automatically fetches new weather data periodically, but stops when battery is low. That said, you're right that the only data you need for such purposes is binary. The current API provides too much info.
- zaroth 10y agoIf it's a native app, then it can already do this. If it's a web app, then hopefully it's only fetching updates if the tab is visible, right? I absolutely think web apps should be checking if their tab is foreground and behaving differently based on that.
- brlewis 10y agoWhat if I want a notification that rain is coming? https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API#Browser_compatibility https://developer.mozilla.org/en-US/docs/Web/API/Notificatio...
- zaroth 10y agoSo what you're saying is that on top of having to deal with low battery, now you're also getting caught in the rain? :-) Don't tell Steve, but if I want to save battery, I swipe closed the browser. If I sign up for rain notifications, I better get my darn rain notification!
- brlewis 10y agoNo, I'm not talking about low battery. You suggested that the app stop checking for weather updates when its tab is not in the foreground. If I do that then I get caught in the rain even with a full battery.
- x1798DE 10y agoHopefully browser tabs don't have any way of triggering system notifications, in which case how would it matter if a webapp stopped automatically updating when the window loses focus?
- Retra 10y agoHow's it going to notify you if you're not looking at the web page?
- brlewis 10y agoSee my link above to the notifications API.