<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>258726</bug_id>
          
          <creation_ts>2023-06-30 06:35:07 -0700</creation_ts>
          <short_desc>navigator.permissions.query for geolocation reporting wrong value</short_desc>
          <delta_ts>2025-06-06 19:41:47 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>Safari 16</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 16</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>293089</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexander Berner">a.berner</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>cdumez</cc>
    
    <cc>marcosc</cc>
    
    <cc>rupin</cc>
    
    <cc>thorsten</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1964466</commentid>
    <comment_count>0</comment_count>
    <who name="Alexander Berner">a.berner</who>
    <bug_when>2023-06-30 06:35:07 -0700</bug_when>
    <thetext>After denying the geolocation after calling navigator.geolocation.getCurrentPosition navigator.permissions.query({name: &quot;geolocation&quot;}) still reports &quot;prompt&quot; instead of denied.

Expected result would be &quot;denied&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1964607</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2023-06-30 23:06:24 -0700</bug_when>
    <thetext>I think this may intentional, but CC&apos;ing people who will know for certain.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1965544</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-07-07 06:36:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/111905576&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1966970</commentid>
    <comment_count>3</comment_count>
    <who name="Alexander Berner">a.berner</who>
    <bug_when>2023-07-16 12:53:21 -0700</bug_when>
    <thetext>Any news if this is behavior is intentional?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1993805</commentid>
    <comment_count>4</comment_count>
    <who name="Marcos Caceres">marcosc</who>
    <bug_when>2023-11-19 19:03:40 -0800</bug_when>
    <thetext>Sorry for the delay. I&apos;m not sure if this is intentional. It should be intentional on initial load of a document, so to not reveal a user preference. However, after an explicit denial from the user, it should probably return &quot;denied&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2036279</commentid>
    <comment_count>5</comment_count>
    <who name="Luca Passariello">luca.passariello</who>
    <bug_when>2024-05-19 04:14:38 -0700</bug_when>
    <thetext>Hi, sorry to stick my nose in, but this is also the case for the opposite scenario. In the current version of Safari (on iOS 17.4.1) when requesting permission and accepting, the status never updates to granted. Even though you do not need to prompt again for the location.

It will update to granted if the user has their global setting as &apos;allow&apos; instead of &apos;ask&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2122299</commentid>
    <comment_count>6</comment_count>
    <who name="">rupin</who>
    <bug_when>2025-06-06 19:37:50 -0700</bug_when>
    <thetext>Fixed in https://bugs.webkit.org/show_bug.cgi?id=293089!

*** This bug has been marked as a duplicate of bug 293089 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2122302</commentid>
    <comment_count>7</comment_count>
    <who name="">rupin</who>
    <bug_when>2025-06-06 19:41:47 -0700</bug_when>
    <thetext>This is fixed in both cases now:

1. If the Geolocation API hasn&apos;t been used (so we haven&apos;t called &quot;getCurrentLocation&quot; or another one of it&apos;s functions), the Permissions API will return PROMPT.
2. If the Geolocation API has been used *within this page load*, the Permissions API will return GRANTED or DENIED depending on the user&apos;s response to the prompt.
3. If the page gets reloaded, this resets, so the Permissions API will once again return PROMPT. 

You can see the full table of behavior and its explanation in this PR: https://github.com/WebKit/WebKit/pull/45470. 

Thank you for reporting the bug and I hope this helps!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>