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

Should a non-persistent notification be auto-closed or not? #204

Open
saschanaz opened this issue Feb 9, 2024 · 1 comment
Open

Should a non-persistent notification be auto-closed or not? #204

saschanaz opened this issue Feb 9, 2024 · 1 comment

Comments

@saschanaz
Copy link
Member

What is the issue with the Notifications API Standard?

Currently the spec says: https://notifications.spec.whatwg.org/#lifetime-and-ui-integrations

User agents should run the close steps for a non-persistent notification a couple of seconds after they have been created.

The actual browser behavior is different:

  1. Chrome and Firefox on Windows do not auto-close non-persistent notifications; and instead clicking the notification after tab close just opens the origin URL.
  2. Safari and Firefox on macOS/Linux auto-close non-persistent notifications if the navigation happens away from the triggering page

We had internal argument against the second behavior; non-persistent notification may also include some crucial content that user would like to keep in the notification center. My immediate impression is that such notification should use persistent way instead, but given the browser differences, I think should discuss about the behavior here for better interop.

@saschanaz
Copy link
Member Author

saschanaz commented Feb 13, 2024

Also nobody clears non-persistent notifications from workers 👀 (Except Firefox has no navigator.serviceWorker at all in workers)

Edit: Maybe we should get something corresponding to declarative web push so that script-triggered persistent notifications won't depend on service workers either.

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

No branches or pull requests

1 participant