Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention or enforce userVisibleOnly check in PushManager.subscribe? #339

Open
youennf opened this issue Oct 11, 2021 · 2 comments
Open

Mention or enforce userVisibleOnly check in PushManager.subscribe? #339

youennf opened this issue Oct 11, 2021 · 2 comments

Comments

@youennf
Copy link

youennf commented Oct 11, 2021

After some testing, it seems that both Chrome and Firefox are disallowing calling PushManager.subscribe with https://w3c.github.io/push-api/#dom-pushsubscriptionoptions-uservisibleonly not present or set to false.
It would be good to indicate this possibility in the specification, for instance as a guideline, or directly within the subscribe algorithm directly.

@marcoscaceres
Copy link
Member

marcoscaceres commented Jun 9, 2022

We should also mention what's described in MDN:

Activating a service worker to deliver a push message can result in increased resource usage, particularly of the battery. Different browsers have different schemes for handling this, there is currently no standard mechanism. Firefox allows a limited number (quota) of push messages to be sent to an application, although Push messages that generate notifications are exempt from this limit. The limit is refreshed each time the site is visited. In Chrome there are no limits.

In particular, we should describe that the UA can take action if a push "event" is received and, for example, no notification is shown (c.f. the subscription might get cancelled, as is the case in Safari I think).

@aarongustafson
Copy link

the subscription might get cancelled, as is the case in Safari

@marcoscaceres To clarify, are you saying that when a "push" event listener within a Service Worker is triggered in Safari and the listener does not include a call to showNotification(), the subscription will be automatically destroyed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants