<?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>242002</bug_id>
          
          <creation_ts>2022-06-25 08:25:40 -0700</creation_ts>
          <short_desc>preventSilentAccess throws NotSupportedError</short_desc>
          <delta_ts>2023-05-22 12:37:24 -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>New Bugs</component>
          <version>Safari 15</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=181082</see_also>
          <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="Luke Warlow">lwarlow</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>pascoe</cc>
    
    <cc>rmondello</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wilander</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1878363</commentid>
    <comment_count>0</comment_count>
    <who name="Luke Warlow">lwarlow</who>
    <bug_when>2022-06-25 08:25:40 -0700</bug_when>
    <thetext>Safari has &quot;implemented&quot; the `preventSilentAccess` function from the Credential Management API (https://w3c.github.io/webappsec-credential-management/#dom-credentialscontainer-preventsilentaccess).

However, it unconditionally throws a NotSupportedError whenever it&apos;s called. This happens on both macOS and iOS from my testing.

The specification doesn&apos;t mention this as an expected behaviour and I was surprised to see that the function is implemented but also not implemented, meaning my feature detection looking for the existence of the function fails.

The below code can be pasted into Web Inspector on a secure domain to demonstrate the issue. Both Chromium and Firefox work correctly but Safari fails.

if (navigator.credentials.preventSilentAccess) {
	console.log(&apos;preventSilentAccess is implemented&apos;);
  navigator.credentials.preventSilentAccess()
		.then(() =&gt; {
			console.log(&apos;preventSilentAccess succeeded&apos;);
		})
    .catch((err) =&gt; {
			console.log(&apos;preventSilentAccess failed&apos;);
      
      console.error(err);
		});
	
} else {
	console.log(&apos;preventSilentAccess is NOT implemented&apos;);
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1878619</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-06-27 16:32:07 -0700</bug_when>
    <thetext>&lt;rdar://problem/96020741&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1878622</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2022-06-27 16:35:51 -0700</bug_when>
    <thetext>This is definitely how it is implemented indeed. It&apos;s been a long time since this code was added, and I couldn&apos;t find any explanation of why it was done this way.

void CredentialsContainer::preventSilentAccess(DOMPromiseDeferred&lt;void&gt;&amp;&amp; promise) const
{
    promise.reject(Exception { NotSupportedError, &quot;Not implemented.&quot;_s });
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1940085</commentid>
    <comment_count>3</comment_count>
    <who name="Luke Warlow">lwarlow</who>
    <bug_when>2023-03-09 09:02:15 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/11303</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1957061</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-05-22 12:37:22 -0700</bug_when>
    <thetext>Committed 264345@main (40294715d0c0): &lt;https://commits.webkit.org/264345@main&gt;

Reviewed commits have been landed. Closing PR #11303 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>