You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browser bug (a bug with a feature that may impact site compatibility)
What information was incorrect, unhelpful, or incomplete?
For geolocation, PermissionStatus.state is always prompt even if permission previously has been granted or denied.
What browsers does this problem apply to, if applicable?
Safari
What did you expect to see?
The corrected state for permission, i.e. prompt, granted (when user previously have granted permission) or denied (when user previously have denied permission).
Did you test this? If so, how?
First run this code. It will prompt the user a request for permission to use geolocation:
navigator.geolocation.getCurrentPosition((geolocationPositionObject)=>{console.log("Permission granted",geolocationPositionObject);},(error)=>{console.error("An error occurred, including denied permission",error);});
Choose to grant or deny permission when prompted.
Reload the page and run the following code:
navigator.permissions.query({name: "geolocation"}).then((permissionStatus)=>{console.log(permissionStatus.state);// Will always log "prompt"});
After the page reload, if running the code in the first block again, no prompt will be shown to user and getCurrentPosition will immediately either succeed (if permission previously was granted) or fail (if permission previously was denied).
Can you link to any release notes, bugs, pull requests, or MDN pages related to this?
This issue was automatically closed because the title was left as the default, and a summary was not added.
If this is not a spam issue, please replace the <SUMMARIZE THE PROBLEM> part of the title with a short summary of the reported issue, and then post a follow-up comment. A maintainer will review your issue and reopen it if needed.
github-actionsbot
added
the
invalid
Invalid issues or pull requests (wrong repo, spam, duplicates, etc.). This won't get merged. Sorry!
label
Nov 11, 2024
jop-io
changed the title
api.PermissionStatus - <SUMMARIZE THE PROBLEM>
api.PermissionStatus - Safari always return "prompt" as value for permissionStatus.state
Nov 11, 2024
queengooborg
added
data:api
Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API
and removed
invalid
Invalid issues or pull requests (wrong repo, spam, duplicates, etc.). This won't get merged. Sorry!
labels
Nov 12, 2024
@queengooborg This looks like a race condition. I have a GitHub project set up with automation that sets the project item status to Done if an issue is closed, and closes the issue if the project item status is set to Done. To avoid this going forward, I have disabled the second automation.
What type of issue is this?
Browser bug (a bug with a feature that may impact site compatibility)
What information was incorrect, unhelpful, or incomplete?
For geolocation,
PermissionStatus.state
is alwaysprompt
even if permission previously has been granted or denied.What browsers does this problem apply to, if applicable?
Safari
What did you expect to see?
The corrected state for permission, i.e.
prompt
,granted
(when user previously have granted permission) ordenied
(when user previously have denied permission).Did you test this? If so, how?
Choose to grant or deny permission when prompted.
getCurrentPosition
will immediately either succeed (if permission previously was granted) or fail (if permission previously was denied).Can you link to any release notes, bugs, pull requests, or MDN pages related to this?
Do you have anything more you want to share?
No response
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus
MDN metadata
MDN page report details
api.PermissionStatus
The text was updated successfully, but these errors were encountered: