From 589e24fc829e1a5ff9827985f453720a4a6c804e Mon Sep 17 00:00:00 2001 From: MDN Date: Sat, 2 Oct 2021 00:48:46 +0000 Subject: [CRON] sync translated content --- files/zh-cn/_redirects.txt | 1 + files/zh-cn/_wikihistory.json | 14 +-- files/zh-cn/web/api/crypto_property/index.html | 118 +++++++++++++++++++++++++ files/zh-cn/web/api/window/crypto/index.html | 117 ------------------------ 4 files changed, 126 insertions(+), 124 deletions(-) create mode 100644 files/zh-cn/web/api/crypto_property/index.html delete mode 100644 files/zh-cn/web/api/window/crypto/index.html (limited to 'files/zh-cn') diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index 1cf17f7a98..77ee25324e 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -1562,6 +1562,7 @@ /zh-CN/docs/Web/API/Window/btoa /zh-CN/docs/Web/API/btoa /zh-CN/docs/Web/API/Window/caches /zh-CN/docs/Web/API/caches /zh-CN/docs/Web/API/Window/clearInterval /zh-CN/docs/Web/API/clearInterval +/zh-CN/docs/Web/API/Window/crypto /zh-CN/docs/Web/API/crypto_property /zh-CN/docs/Web/API/Window/minimize /zh-CN/docs/conflicting/Web/API/Window /zh-CN/docs/Web/API/Window/mozAnimationStartTIme /zh-CN/docs/Web/API/Animation/startTime /zh-CN/docs/Web/API/Window/onbeforeunload /zh-CN/docs/Web/API/WindowEventHandlers/onbeforeunload diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index 22633218c1..6c130b2ef9 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -22875,13 +22875,6 @@ "Jee" ] }, - "Web/API/Window/crypto": { - "modified": "2019-03-23T22:22:09.825Z", - "contributors": [ - "koaqiu", - "Taoja" - ] - }, "Web/API/Window/customElements": { "modified": "2020-10-15T22:02:36.021Z", "contributors": [ @@ -24519,6 +24512,13 @@ "Fulgrim" ] }, + "Web/API/crypto_property": { + "modified": "2019-03-23T22:22:09.825Z", + "contributors": [ + "koaqiu", + "Taoja" + ] + }, "Web/API/element/scrollWidth": { "modified": "2019-12-11T06:18:59.921Z", "contributors": [ diff --git a/files/zh-cn/web/api/crypto_property/index.html b/files/zh-cn/web/api/crypto_property/index.html new file mode 100644 index 0000000000..9af4f22a8c --- /dev/null +++ b/files/zh-cn/web/api/crypto_property/index.html @@ -0,0 +1,118 @@ +--- +title: Window.crypto +slug: Web/API/crypto_property +translation_of: Web/API/Window/crypto +original_slug: Web/API/Window/crypto +--- +
{{APIRef}}
+ +

Window.crypto只读属性返回与全局对象关联的 {{domxref("Crypto")}}对象。 此对象允许网页访问某些加密相关服务。

+ +

语法

+ +
var cryptoObj = window.crypto || window.msCrypto; // for IE 11
+
+ +

范例

+ +

使用 {{domxref("Window.crypto")}} 来访问getRandomValues() 方法.

+ +

JavaScript

+ +
genRandomNumbers = function getRandomNumbers() {
+  var array = new Uint32Array(10);
+  window.crypto.getRandomValues(array);
+
+  var randText = document.getElementById("myRandText");
+  randText.innerHTML = "The random numbers are: "
+  for (var i = 0; i < array.length; i++) {
+    randText.innerHTML += array[i] + " ";
+  }
+}
+
+ +

HTML

+ +
<p id="myRandText">随机数字: </p>
+<button type="button" onClick='genRandomNumbers()'>生成10个随机数字</button>
+ +

结果

+ +

{{ EmbedLiveSample('Example') }}

+ +

规范

+ + + + + + + + + + + + + + +
规范状态批注
{{SpecName("Web Crypto API", "#dfn-GlobalCrypto", "Window.crypto")}}{{Spec2("Web Crypto API")}}Initial definition
+ +

浏览器支持

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerEdgeOperaSafari
Basic support44 {{CompatVersionUnknown}}{{CompatVersionUnknown}}11 {{property_prefix("ms")}}2019{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChrome for AndroidFirefox MobileFirefox OSIE PhoneOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

另见

+ + diff --git a/files/zh-cn/web/api/window/crypto/index.html b/files/zh-cn/web/api/window/crypto/index.html deleted file mode 100644 index d8a732b86e..0000000000 --- a/files/zh-cn/web/api/window/crypto/index.html +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: Window.crypto -slug: Web/API/Window/crypto -translation_of: Web/API/Window/crypto ---- -
{{APIRef}}
- -

Window.crypto只读属性返回与全局对象关联的 {{domxref("Crypto")}}对象。 此对象允许网页访问某些加密相关服务。

- -

语法

- -
var cryptoObj = window.crypto || window.msCrypto; // for IE 11
-
- -

范例

- -

使用 {{domxref("Window.crypto")}} 来访问getRandomValues() 方法.

- -

JavaScript

- -
genRandomNumbers = function getRandomNumbers() {
-  var array = new Uint32Array(10);
-  window.crypto.getRandomValues(array);
-
-  var randText = document.getElementById("myRandText");
-  randText.innerHTML = "The random numbers are: "
-  for (var i = 0; i < array.length; i++) {
-    randText.innerHTML += array[i] + " ";
-  }
-}
-
- -

HTML

- -
<p id="myRandText">随机数字: </p>
-<button type="button" onClick='genRandomNumbers()'>生成10个随机数字</button>
- -

结果

- -

{{ EmbedLiveSample('Example') }}

- -

规范

- - - - - - - - - - - - - - -
规范状态批注
{{SpecName("Web Crypto API", "#dfn-GlobalCrypto", "Window.crypto")}}{{Spec2("Web Crypto API")}}Initial definition
- -

浏览器支持

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerEdgeOperaSafari
Basic support44 {{CompatVersionUnknown}}{{CompatVersionUnknown}}11 {{property_prefix("ms")}}2019{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureChrome for AndroidFirefox MobileFirefox OSIE PhoneOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -

另见

- - -- cgit v1.2.3-54-g00ecf