api.PermissionStatus - Safari always return "prompt" as value for permissionStatus.state
Nobody has claimed this yet.
- Dominant language
- JSON
- Stars
- 5.8k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 186
Description
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 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
getCurrentPositionwill 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?
- https://forums.developer.apple.com/forums/thread/751189
- https://stackoverflow.com/questions/75872915/geolocation-is-already-allowed-on-ios-safari-16-but-navigator-permissions-still
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
- Query:
api.PermissionStatus - Report started: 2024-11-11T13:07:44.669Z
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the PermissionStatus entry for the Permissions API and compare Safari's geolocation behavior with the linked Apple forum and Stack Overflow reports. Check the repository's relevant validation checks, and consider the work done when the compatibility data accurately reflects the reported Safari behavior and its supported permission states.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100