-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add a fourth permission state "grantable without a prompt"? #250
Comments
Maybe we can finally introduce "default" and get it to align with the Notifications API? Where "default" is: This is equivalent to "denied", but the user has made no explicit choice thus far. So:
|
Noting, in hindsight, "prompt" was probably a mistake, as we shouldn't of tied this to UI at all... but given we are here... "default" might just work. And perhaps we can move more things to "default" without breaking thing. |
The difference between |
So now we have the following,
But I'm not sure that solves what @mkruisselbrink is asking for. We want something that means "granted when its been requested, but not yet requested". Maybe "default" is the way to go. Or we spell "default" as "grantable". 🤔 A spec like persistent-storage could define the default as "granted", but I think that would be misleading and then devs wouldn't know they should request it. But maybe Storage is a bad example, because devs can just use |
Another way to tackling this is to modify https://w3c.github.io/permissions/#dfn-request-permission-to-use to take an optional "override" flag that skips the whole "express permission" thing. I'm not sure it's a great idea, but it's an idea. |
In chrome we have (or will have) some permissions that under certain circumstances are in a state where the permission isn't granted yet, but will be granted without showing a prompt if the permission is requested. That state is not currently something that can really be expressed by the permissions API, with the closest equivalent being simply "prompt". However sometimes websites would really like to know if requesting a permission will actually show a prompt or not, to be able to provide better UI to their users.
Not sure if adding a fourth permission state for this case makes sense, and changing this for existing permissions would likely not be web compatible either, but was mostly wondering what other people think of this...
(currently Chrome uses this state for the Persistent Storage permission, but we're also considering using this in some cases for the file system permission).
The text was updated successfully, but these errors were encountered: