CredentialsContainer: preventSilentAccess() method

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2023.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The preventSilentAccess() method of the CredentialsContainer interface sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns a Promise that resolves to undefined. For example, you might call this, after a user signs out of a website to ensure that they aren't automatically signed in on the next site visit. Mediation varies by origin, and is an added check point of browser stored credentials, informing a user of an account login status. This method is typically called after a user signs out of a website, ensuring this user's login information is not automatically passed on the next site visit.

When using a PublicKeyCredential, this method generally has no effect; such authenticators typically require user interaction. However, it is possible that certain authenticators may be excluded, which could otherwise have operated silently.

Earlier versions of the spec called this method requireUserMediation(). The Browser compatibility section has support details.

Syntax

js
preventSilentAccess()

Parameters

None.

Return value

A Promise that resolves to undefined.

Specifications

Specification
Credential Management Level 1
# dom-credentialscontainer-preventsilentaccess

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
preventSilentAccess
Chrome – No support
Chrome 51 – 59 (Release date: 2016-05-25)
altname
altname Alternate name: requireUserMediation
Chrome – Full support
Chrome 60 (Release date: 2017-07-25)
footnote Full support
Edge – Full support
Edge 18 (Release date: 2018-10-02)
footnote Full support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera 38 – 46 (Release date: 2016-06-08)
altname
altname Alternate name: requireUserMediation
Opera – Full support
Opera 47 (Release date: 2017-08-09)
footnote Full support
Safari – Partial support
Safari 13 – 16.6 (Release date: 2019-09-19)
footnote Partial support
footnote This method exists, but always rejected with a NotSupportedError exception.
Safari – Full support
Safari 17 (Release date: 2023-09-18)
footnote Full support
Chrome Android – No support
Chrome Android 51 – 59 (Release date: 2016-06-08)
altname
altname Alternate name: requireUserMediation
Chrome Android – Full support
Chrome Android 60 (Release date: 2017-08-01)
footnote Full support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Opera Android – No support
Opera Android 41 – 43 (Release date: 2016-10-25)
altname
altname Alternate name: requireUserMediation
Opera Android – Full support
Opera Android 44 (Release date: 2017-12-11)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 13 – 16.6 (Release date: 2019-09-19)
footnote Partial support
footnote This method exists, but always rejected with a NotSupportedError exception.
Safari on iOS – Full support
Safari on iOS 17 (Release date: 2023-09-18)
footnote Full support
Samsung Internet – No support
Samsung Internet 5 – 7.4 (Release date: 2016-12-15)
altname
altname Alternate name: requireUserMediation
Samsung Internet – Full support
Samsung Internet 8 (Release date: 2018-07-18)
footnote Full support
WebView Android – No support
WebView Android 51 – 59 (Release date: 2016-06-08)
altname
altname Alternate name: requireUserMediation
WebView Android – Full support
WebView Android 60 (Release date: 2017-08-01)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 13 – 16.6 (Release date: 2019-09-19)
footnote Partial support
footnote This method exists, but always rejected with a NotSupportedError exception.
WebView on iOS – Full support
WebView on iOS 17 (Release date: 2023-09-18)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
Uses a non-standard name
Has more compatibility info.