aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/credentialscontainer
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/credentialscontainer
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/credentialscontainer')
-rw-r--r--files/zh-cn/web/api/credentialscontainer/index.html150
1 files changed, 150 insertions, 0 deletions
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
+---
+<p>{{SeeCompatTable}}{{APIRef("Credential Management API")}}</p>
+
+<p><a href="/en-US/docs/Web/API/Credential_Management_API">Credential Management API</a> 的 <strong><code>CredentialsContainer</code></strong> 接口提供了请求 credentials 和通知用户代理(当成功登陆或登出事件发生时)的方法。可通过  <code>Navigator.credentials </code>获得该接口。</p>
+
+<h2 id="属性">属性</h2>
+
+<p>None.</p>
+
+<h3 id="事件">事件</h3>
+
+<p>None.</p>
+
+<p> </p>
+
+<p>返回一个带有处理值  <code><a href="https://w3c.github.io/webappsec-credential-management/#credential" id="ref-for-credential-34">Credential</a></code>(若它能够使用提供的选项创建的话)的 <code><a href="https://heycam.github.io/webidl/#idl-promise">Promise</a></code> ,或返回  <code>null</code>(若不能创建 <code><a href="https://w3c.github.io/webappsec-credential-management/#credential" id="ref-for-credential-35">Credential</a></code>)。在特殊情况下,返回的 <code><a href="https://heycam.github.io/webidl/#idl-promise">Promise</a></code> 对象可能 reject。</p>
+
+<h2 id="方法">方法</h2>
+
+<dl>
+ <dt>{{domxref("CredentialsContainer.create()")}}</dt>
+ <dd>Returns a {{jsxref("Promise")}} that resolves with a new {{domxref("Credential")}} instance based on the provided options, or <code>null</code> of no <code>Credential</code> object can be created.</dd>
+ <dt>{{domxref("CredentialsContainer.get()")}}</dt>
+ <dd>Returns a {{jsxref("Promise")}} that resolves with the {{domxref("Credential")}} instance that matches the provided parameters.</dd>
+ <dt>{{domxref("CredentialsContainer.preventSilentAccess()")}}</dt>
+ <dd>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 <code>requireUserMediation()</code>. See {{anch("Browser compatibility")}} for support details.</dd>
+ <dt>{{domxref("CredentialsContainer.store()")}}</dt>
+ <dd>Stores a set of credentials for a user, inside a provided {{domxref("Credential")}} instance and returns that instance in a {{jsxref("Promise")}}.</dd>
+</dl>
+
+<h2 id="示例">示例</h2>
+
+<pre class="brush: js">// TBD</pre>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('Credential Management')}}</td>
+ <td>{{Spec2('Credential Management')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>
+ <p>{{CompatChrome(51)}}</p>
+ </td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td><code>create()</code></td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td><code>requireUserMediation()</code> renamed <code>preventSilentAccess()</code></td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android Webview</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>Firefox OS</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>
+ <p>{{CompatChrome(51)}}</p>
+ </td>
+ <td>
+ <p>{{CompatChrome(51)}}</p>
+ </td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td><code>create()</code></td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td><code>requireUserMediation()</code> renamed <code>preventSilentAccess()</code></td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>