From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../zh-cn/web/api/credentialscontainer/index.html | 150 +++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 files/zh-cn/web/api/credentialscontainer/index.html (limited to 'files/zh-cn/web/api/credentialscontainer/index.html') diff --git a/files/zh-cn/web/api/credentialscontainer/index.html b/files/zh-cn/web/api/credentialscontainer/index.html new file mode 100644 index 0000000000..13b25b9a44 --- /dev/null +++ b/files/zh-cn/web/api/credentialscontainer/index.html @@ -0,0 +1,150 @@ +--- +title: CredentialsContainer +slug: Web/API/CredentialsContainer +translation_of: Web/API/CredentialsContainer +--- +

{{SeeCompatTable}}{{APIRef("Credential Management API")}}

+ +

Credential Management API 的 CredentialsContainer 接口提供了请求 credentials 和通知用户代理(当成功登陆或登出事件发生时)的方法。可通过  Navigator.credentials 获得该接口。

+ +

属性

+ +

None.

+ +

事件

+ +

None.

+ +

 

+ +

返回一个带有处理值  Credential(若它能够使用提供的选项创建的话)的 Promise ,或返回  null(若不能创建 Credential)。在特殊情况下,返回的 Promise 对象可能 reject。

+ +

方法

+ +
+
{{domxref("CredentialsContainer.create()")}}
+
Returns a {{jsxref("Promise")}} that resolves with a new {{domxref("Credential")}} instance based on the provided options, or null of no Credential object can be created.
+
{{domxref("CredentialsContainer.get()")}}
+
Returns a {{jsxref("Promise")}} that resolves with the {{domxref("Credential")}} instance that matches the provided parameters.
+
{{domxref("CredentialsContainer.preventSilentAccess()")}}
+
Sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns an empty {{jsxref("Promise")}}. For example, you might call this, after a user signs out of a website to ensure that he/she isn't automatically signed in on the next site visit. Earlier versions of the spec called this method requireUserMediation(). See {{anch("Browser compatibility")}} for support details.
+
{{domxref("CredentialsContainer.store()")}}
+
Stores a set of credentials for a user, inside a provided {{domxref("Credential")}} instance and returns that instance in a {{jsxref("Promise")}}.
+
+ +

示例

+ +
// TBD
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Credential Management')}}{{Spec2('Credential Management')}}Initial definition.
+ +

浏览器兼容性

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support +

{{CompatChrome(51)}}

+
{{CompatUnknown}}{{CompatUnknown}}{{CompatNo}}{{CompatUnknown}}
create(){{CompatChrome(60)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatNo}}{{CompatUnknown}}
requireUserMediation() renamed preventSilentAccess(){{CompatChrome(60)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatNo}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroid WebviewChrome for AndroidFirefox Mobile (Gecko)Firefox OSIE MobileOpera MobileSafari Mobile
Basic support +

{{CompatChrome(51)}}

+
+

{{CompatChrome(51)}}

+
{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatNo}}{{CompatUnknown}}
create(){{CompatChrome(60)}}{{CompatChrome(60)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatNo}}{{CompatUnknown}}
requireUserMediation() renamed preventSilentAccess(){{CompatChrome(60)}}{{CompatChrome(60)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatNo}}{{CompatUnknown}}
+
-- cgit v1.2.3-54-g00ecf