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

check and consume user activation #348

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from
Open

Conversation

marcoscaceres
Copy link
Member

@marcoscaceres marcoscaceres commented Jun 1, 2022

@marcoscaceres
Copy link
Member Author

Preparing a WPTest...

@beverloo
Copy link
Member

I'm not sure this is Web compatible -

  1. subscribe() can be called from within a service worker, where there are no local activations that can be consumed -- particularly the consume user activation steps assume that there's a window.
  2. Looking at our metrics, only about a fourth of permission requests happen with a gesture. We mitigate against this by displaying a different user interface (if any at all) in those cases. In my reading it would be valid for an implementation not to show any prompt at all.

@saschanaz
Copy link
Member

Note that Gecko opted to require user activation only if the permission is not granted, and just proceeds without activation if it's granted, which I think is the best way as reportedly some websites repeatedly calls pushManager.subscribe() every time: https://bugzilla.mozilla.org/show_bug.cgi?id=1486010#c5

Instead, the page calls pushManager.subscribe every time you visit it

@marcoscaceres
Copy link
Member Author

I'll take a closer look at what WebKit does... we might be doing something similar @saschanaz.

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

Successfully merging this pull request may close these issues.

Does PushManager subscribe() need transient activation check?
4 participants