-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Web Push userVisibleOnly Details #30077
Comments
The read-only You're saying that browsers reject a subscription if It looks like the I agree that the definition of |
@caugner Yep, my bad on the wrong page, mixed up the pages when I had so many open, |
I learned about this issue on Mastodon because @captainbrosset tooted about it. When trying the demo at https://attractive-tranquil-nephew.glitch.me/ I cannot reproduce the behaviour in Firefox 115.0.2 on Debian/Linux. Nevertheless I would be willing to submit a PR that addresses this:
|
The error message seems to be displayed on Chromium-based browsers (in the Console panel of DevTools). Nothing seems to happen in Firefox. |
Confirmed (as in: Promise rejected logged to the console) with Chromium Version 119.0.6045.159 (Official Build) built on Debian 12.2, running on Debian (64-bit). |
I've submitted #30369 and checked the other MDN pages. As far as I can tell, the property is always set to |
I think this is sufficiently fixed by #30369 |
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/PushSubscriptionOptions/userVisibleOnly
What specific section or headline is this issue about?
No response
What information was incorrect, unhelpful, or incomplete?
The Push API spec includes a
userVisibleOnly
option, that MDN implies is fully functional for WebKit or Chromium browsers but isn't actually the case. Both will reject the promise requiring it to be true.Normally an API predictably rejecting a promise isn't a huge deal, but if a developer goes through the overhead of understanding
applicationServerKey
, VAPID, push services, etc. only to see "Promise Rejected", that could be extremely frustrating.At a minimum it seems like the page PushSubscription options should include details on this, but the following pages could probably use more aggressive dissuading developers from trying to use push for non-visible cases:
For completeness, I could I only find one page online calling out this behavior - https://web.dev/articles/push-notifications-subscribing-a-user#uservisibleonly_options
What did you expect to see?
That browsers might reject a subscription if
userVisibleOnly
is set to false. Happy to open an issue and/or PR on the browser-compat-data side if that's the best place to approach this too.Do you have any supporting links, references, or citations?
Do you have anything more you want to share?
No response
The text was updated successfully, but these errors were encountered: