Re: [w3c/ServiceWorker] Expose GeoLocation to workers (#745)

To reiterate my previous comments: Service workers aren't intended for continual background operation in the way that's being proposed here. They're designed to wake up for an event, briefly handle it, then go away. This should be especially brief if the user doesn't have a tab open to the site.

Keeping a tab awake is a better solution as it isn't geo-location specific and enables a wider range of use-cases. It's also more privacy friendly as there's a tab the user can close to cease activity. On mobile, a sticky notification can inform the user about locked tabs/apps, and tapping the notification can return them to the tab. This is pretty much how Android does things natively.

This shouldn't be any worse for battery, unless your page is using more CPU than it needs to, eg doing work to update the page visually while it isn't visible. The page visibility API helps here, and CSS animations / `requestAnimationFrame` already stop when the tab isn't visible.

It's possible that memory usage will be greater keeping a page open vs a service worker, but I'm not sure by how much. If this turns out to be an issue, we could look at ways to fix it (I'm not convinced it'd be using a service worker).

> For any given GeoFence…

To clarify, I'm referring to the kind of geo tracking that an exercise tracker would need. Geofencing is a different thing, and does kinda fit with service worker's model.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/745#issuecomment-306432323

Received on Tuesday, 6 June 2017 09:30:27 UTC