mdn / mdn/browser-compat-data

api.PermissionStatus - Safari always return "prompt" as value for permissionStatus.state

Open
#25,032 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

browser:safari data:api
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?
  1. 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.

  1. Reload the page and run the following code:
navigator.permissions
    .query({ name: "geolocation" })
    .then((permissionStatus) => {
        console.log(permissionStatus.state); // Will always log "prompt"
    }
);
  1. 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?
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.