Re: [w3ctag/design-reviews] Periodic Background Sync (#367)

Thanks for the question Hadley.

We have to distinguish between controls the developer has for this API, and those the user does. Our reasoning is that the developer can't reliably differentiate a metered connection from an unmetered one, any better than the browser can. The browser doesn't need to rely on the developer correctly setting these levers when it can detect these situations itself.

You are right that there may be cases when the browser might not detect the type of connection correctly, like the tethering example you gave.
The user can, through mechanisms such as turning on "Data Saver" mode, indicate to all apps on the device that data should be consumed conservatively. It is recommended that the browser not send periodicsync events when in Data Saver mode and connected to cellular networks. (see bug for Chrome here: https://bugs.chromium.org/p/chromium/issues/detail?id=529351)
I've sent a PR to the explainer to include this recommendation, thanks for pointing it out:
https://github.com/beverloo/periodic-background-sync/pull/16

Regarding your other question, note that Permissions API is simply a way for the developer to query the status of this permission through Javascript. A user prompt may or may not be shown to the user, depending on the browser implementation. Chrome's current implementation automatically denies 'periodic-background-sync' for any request made from outside a PWA and no user prompt is shown. My point is that even if the browser has an implementation of the Permissions API, the user might not be prompted for a permission.

However, the spec can mandate that the user or the user agent on behalf of the user grant permission before this API can be used. (I'm looking at https://notifications.spec.whatwg.org/#permission-model for inspiration). I've proposed adding words to this effect in the PR as well:
https://github.com/beverloo/periodic-background-sync/pull/16

How to revoke the permission is again browser implementation dependent and will be done through the browser's UI. The Permission API spec mandates that the browser implementation must notify the appropriate components when the user revokes permission for a capability for a site.
(https://www.w3.org/TR/permissions/#reacting-to-revocation)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/367#issuecomment-530381631

Received on Wednesday, 11 September 2019 13:32:17 UTC