8000 check and consume user activation by marcoscaceres · Pull Request #348 · w3c/push-api · GitHub
[go: up one dir, main page]

Skip to content

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

0