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

The allowed values of Notification.requestPermission() differ between spec and implementations #197

Open
saschanaz opened this issue Aug 7, 2023 · 1 comment

Comments

@saschanaz
Copy link
Member

saschanaz commented Aug 7, 2023

https://notifications.spec.whatwg.org/#dom-notification-requestpermission

  1. Let permissionState be the result of requesting permission to use "notifications".

And the Permissions term: https://w3c.github.io/permissions/#dfn-request-permission-to-use

This algorithm returns either "granted" or "denied".

But in reality the static function can return "default" too:

  1. Firefox returns "default" when the function is called without transient user activation
  2. Chrome returns "default" when the prompt is closed by clicking X button

(Safari returns "denied" when without transient user activation, but that's weird because it disagrees with Notification.permission then.)

Should we have an optional step that covers transient user activation #108 ? The Chrome case should probably be covered in Permissions spec instead.

@annevk
Copy link
Member

annevk commented Aug 28, 2023

Yeah, that sounds reasonable.

It seems that Permissions should be able to return "prompt" as well (e.g., when the user dismisses the prompt in that manner), which we'd then translate to "default".

cc @johannhof @marcoscaceres

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

2 participants