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/es/_redirects.txt | 1 + files/es/_wikihistory.json | 16 +-- files/es/web/api/crypto_property/index.html | 89 +++++++++++++++++ files/es/web/api/window/crypto/index.html | 88 ----------------- files/fr/_redirects.txt | 1 + files/fr/_wikihistory.json | 16 +-- files/fr/web/api/crypto_property/index.html | 44 +++++++++ files/fr/web/api/window/crypto/index.html | 43 --------- files/ja/_redirects.txt | 7 +- files/ja/_wikihistory.json | 22 ++--- files/ja/web/api/crypto_property/index.html | 75 ++++++++++++++ files/ja/web/api/window/crypto/index.html | 74 -------------- files/ko/_redirects.txt | 1 + files/ko/_wikihistory.json | 14 +-- files/ko/web/api/crypto_property/index.html | 76 +++++++++++++++ files/ko/web/api/window/crypto/index.html | 75 -------------- files/pl/_redirects.txt | 5 +- files/pl/_wikihistory.json | 20 ++-- files/pl/web/api/crypto_property/index.html | 20 ++++ files/pl/web/api/window/crypto/index.html | 19 ---- files/pt-br/_redirects.txt | 1 + files/pt-br/_wikihistory.json | 14 +-- files/pt-br/web/api/crypto_property/index.html | 129 +++++++++++++++++++++++++ files/pt-br/web/api/window/crypto/index.html | 128 ------------------------ files/ru/_redirects.txt | 1 + files/ru/_wikihistory.json | 12 +-- files/ru/web/api/crypto_property/index.html | 46 +++++++++ files/ru/web/api/window/crypto/index.html | 45 --------- 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 ---------------------- 32 files changed, 674 insertions(+), 658 deletions(-) create mode 100644 files/es/web/api/crypto_property/index.html delete mode 100644 files/es/web/api/window/crypto/index.html create mode 100644 files/fr/web/api/crypto_property/index.html delete mode 100644 files/fr/web/api/window/crypto/index.html create mode 100644 files/ja/web/api/crypto_property/index.html delete mode 100644 files/ja/web/api/window/crypto/index.html create mode 100644 files/ko/web/api/crypto_property/index.html delete mode 100644 files/ko/web/api/window/crypto/index.html create mode 100644 files/pl/web/api/crypto_property/index.html delete mode 100644 files/pl/web/api/window/crypto/index.html create mode 100644 files/pt-br/web/api/crypto_property/index.html delete mode 100644 files/pt-br/web/api/window/crypto/index.html create mode 100644 files/ru/web/api/crypto_property/index.html delete mode 100644 files/ru/web/api/window/crypto/index.html 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') diff --git a/files/es/_redirects.txt b/files/es/_redirects.txt index a07f527a28..9fbaa853f2 100644 --- a/files/es/_redirects.txt +++ b/files/es/_redirects.txt @@ -1579,6 +1579,7 @@ /es/docs/Web/API/Window.navigator /es/docs/Web/API/Window/navigator /es/docs/Web/API/Window.onbeforeunload /es/docs/Web/API/WindowEventHandlers/onbeforeunload /es/docs/Web/API/Window.setTimeout /es/docs/Web/API/setTimeout +/es/docs/Web/API/Window/crypto /es/docs/Web/API/crypto_property /es/docs/Web/API/WindowBase64.atob /es/docs/Web/API/atob /es/docs/Web/API/WindowBase64/Base64_codificando_y_decodificando /es/docs/Glossary/Base64 /es/docs/Web/API/WindowBase64/atob /es/docs/Web/API/atob diff --git a/files/es/_wikihistory.json b/files/es/_wikihistory.json index 4b1222be2c..0e8a142a68 100644 --- a/files/es/_wikihistory.json +++ b/files/es/_wikihistory.json @@ -8808,14 +8808,6 @@ "julian3xl" ] }, - "Web/API/Window/crypto": { - "modified": "2020-02-12T20:26:38.795Z", - "contributors": [ - "joseluisq", - "AlePerez92", - "victorjavierss" - ] - }, "Web/API/Window/devicePixelRatio": { "modified": "2019-03-23T22:33:20.853Z", "contributors": [ @@ -9238,6 +9230,14 @@ "Bumxu" ] }, + "Web/API/crypto_property": { + "modified": "2020-02-12T20:26:38.795Z", + "contributors": [ + "joseluisq", + "AlePerez92", + "victorjavierss" + ] + }, "Web/API/fetch": { "modified": "2020-10-15T22:01:57.457Z", "contributors": [ diff --git a/files/es/web/api/crypto_property/index.html b/files/es/web/api/crypto_property/index.html new file mode 100644 index 0000000000..a908f8b4f5 --- /dev/null +++ b/files/es/web/api/crypto_property/index.html @@ -0,0 +1,89 @@ +--- +title: Window.crypto +slug: Web/API/crypto_property +translation_of: Web/API/Window/crypto +original_slug: Web/API/Window/crypto +--- +

{{APIRef}}

+ +

La propiedad de sólo lectura {{domxref("Window.crypto")}} devuelve el objeto Crypto asociado a un objeto global. Este objeto permite a las páginas web acceder a ciertos servicios relacionados con criptografía.

+ +

Sintaxis

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

Especificaciones

+ + + + + + + + + + + + + + +
EspecificaciónEstadoComentario
{{SpecName('Web Crypto API')}}{{Spec2('Web Crypto API')}}Definición Inicial
+ +

Compatibilidad de Navegadores

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Sporte Básico{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}11 {{ property_prefix("-ms") }}15{{ CompatVersionUnknown() }}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome para AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Soporte Básico{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
+
+ +

Ver También

+ + diff --git a/files/es/web/api/window/crypto/index.html b/files/es/web/api/window/crypto/index.html deleted file mode 100644 index 49756dfc08..0000000000 --- a/files/es/web/api/window/crypto/index.html +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: Window.crypto -slug: Web/API/Window/crypto -translation_of: Web/API/Window/crypto ---- -

{{APIRef}}

- -

La propiedad de sólo lectura {{domxref("Window.crypto")}} devuelve el objeto Crypto asociado a un objeto global. Este objeto permite a las páginas web acceder a ciertos servicios relacionados con criptografía.

- -

Sintaxis

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

Especificaciones

- - - - - - - - - - - - - - -
EspecificaciónEstadoComentario
{{SpecName('Web Crypto API')}}{{Spec2('Web Crypto API')}}Definición Inicial
- -

Compatibilidad de Navegadores

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Sporte Básico{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}11 {{ property_prefix("-ms") }}15{{ CompatVersionUnknown() }}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
CaracterísticaAndroidChrome para AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Soporte Básico{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
-
- -

Ver También

- - diff --git a/files/fr/_redirects.txt b/files/fr/_redirects.txt index 75a6c649fe..67ce230c91 100644 --- a/files/fr/_redirects.txt +++ b/files/fr/_redirects.txt @@ -3789,6 +3789,7 @@ /fr/docs/Web/API/Window.showModalDialog /fr/docs/Web/API/Window/showModalDialog /fr/docs/Web/API/Window/URL /fr/docs/conflicting/Web/API/URL /fr/docs/Web/API/Window/caches /fr/docs/Web/API/caches +/fr/docs/Web/API/Window/crypto /fr/docs/Web/API/crypto_property /fr/docs/Web/API/Window/gamepaddisconnected /fr/docs/Web/API/Window/gamepaddisconnected_event /fr/docs/Web/API/Window/mozAnimationStartTime /fr/docs/Web/API/Animation/startTime /fr/docs/Web/API/Window/ondevicelight /fr/docs/orphaned/Web/API/Window/ondevicelight diff --git a/files/fr/_wikihistory.json b/files/fr/_wikihistory.json index 6ecbbc4a2f..9e05ffbc28 100644 --- a/files/fr/_wikihistory.json +++ b/files/fr/_wikihistory.json @@ -20813,14 +20813,6 @@ "Voulto" ] }, - "Web/API/Window/crypto": { - "modified": "2019-06-12T16:41:52.512Z", - "contributors": [ - "plyd", - "foxstorm", - "alandrieu" - ] - }, "Web/API/Window/customElements": { "modified": "2019-03-18T21:37:51.562Z", "contributors": [ @@ -21957,6 +21949,14 @@ "Eliastik" ] }, + "Web/API/crypto_property": { + "modified": "2019-06-12T16:41:52.512Z", + "contributors": [ + "plyd", + "foxstorm", + "alandrieu" + ] + }, "Web/API/fetch": { "modified": "2020-11-16T08:26:54.613Z", "contributors": [ diff --git a/files/fr/web/api/crypto_property/index.html b/files/fr/web/api/crypto_property/index.html new file mode 100644 index 0000000000..80365515c5 --- /dev/null +++ b/files/fr/web/api/crypto_property/index.html @@ -0,0 +1,44 @@ +--- +title: Window.crypto +slug: Web/API/crypto_property +translation_of: Web/API/Window/crypto +original_slug: Web/API/Window/crypto +--- +

{{APIRef}}

+ +

La propriété, en lecture seule, {{domxref("Window.crypto")}} retourne l'objet {{domxref("Crypto")}}  associé à l'objet global. Cet objet permet aux pages web d'avoir un accès à certains services liés à cryptographie.

+ +

Syntaxe

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

Spécifications

+ + + + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName("Web Crypto API", "#dfn-GlobalCrypto", "Window.crypto")}}{{Spec2("Web Crypto API")}}Définition initiale
+ +

Compatibilité des navigateurs

+ +

{{Compat("api.Window.crypto")}}

+ +

Voir aussi

+ + diff --git a/files/fr/web/api/window/crypto/index.html b/files/fr/web/api/window/crypto/index.html deleted file mode 100644 index d669c22629..0000000000 --- a/files/fr/web/api/window/crypto/index.html +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: Window.crypto -slug: Web/API/Window/crypto -translation_of: Web/API/Window/crypto ---- -

{{APIRef}}

- -

La propriété, en lecture seule, {{domxref("Window.crypto")}} retourne l'objet {{domxref("Crypto")}}  associé à l'objet global. Cet objet permet aux pages web d'avoir un accès à certains services liés à cryptographie.

- -

Syntaxe

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

Spécifications

- - - - - - - - - - - - - - - - -
SpécificationStatutCommentaire
{{SpecName("Web Crypto API", "#dfn-GlobalCrypto", "Window.crypto")}}{{Spec2("Web Crypto API")}}Définition initiale
- -

Compatibilité des navigateurs

- -

{{Compat("api.Window.crypto")}}

- -

Voir aussi

- - diff --git a/files/ja/_redirects.txt b/files/ja/_redirects.txt index 4c3a2108cd..d17aaa1c72 100644 --- a/files/ja/_redirects.txt +++ b/files/ja/_redirects.txt @@ -1469,7 +1469,7 @@ /ja/docs/DOM/window.confirm-redirect-1 /ja/docs/Web/API/Window/confirm /ja/docs/DOM/window.content /ja/docs/Web/API/Window/content /ja/docs/DOM/window.controllers /ja/docs/Web/API/Window/controllers -/ja/docs/DOM/window.crypto /ja/docs/Web/API/Window/crypto +/ja/docs/DOM/window.crypto /ja/docs/Web/API/crypto_property /ja/docs/DOM/window.defaultStatus /ja/docs/Web/API/Window/defaultStatus /ja/docs/DOM/window.directories /ja/docs/Web/API/Window/directories /ja/docs/DOM/window.document /ja/docs/Web/API/Window/document @@ -1695,7 +1695,7 @@ /ja/docs/DOM:window.confirm /ja/docs/Web/API/Window/confirm /ja/docs/DOM:window.content /ja/docs/Web/API/Window/content /ja/docs/DOM:window.controllers /ja/docs/Web/API/Window/controllers -/ja/docs/DOM:window.crypto /ja/docs/Web/API/Window/crypto +/ja/docs/DOM:window.crypto /ja/docs/Web/API/crypto_property /ja/docs/DOM:window.defaultStatus /ja/docs/Web/API/Window/defaultStatus /ja/docs/DOM:window.directories /ja/docs/Web/API/Window/directories /ja/docs/DOM:window.document /ja/docs/Web/API/Window/document @@ -3283,6 +3283,7 @@ /ja/docs/Web/API/Window.onafterprint /ja/docs/Web/API/WindowEventHandlers/onafterprint /ja/docs/Web/API/Window/URL /ja/docs/Web/API/URL /ja/docs/Web/API/Window/arguments /ja/docs/orphaned/Working_with_windows_in_chrome_code +/ja/docs/Web/API/Window/crypto /ja/docs/Web/API/crypto_property /ja/docs/Web/API/Window/dispatchEvent /ja/docs/Web/API/EventTarget/dispatchEvent /ja/docs/Web/API/Window/escape /ja/docs/Web/JavaScript/Reference/Global_Objects/escape /ja/docs/Web/API/Window/getAttention /ja/docs/orphaned/Web/API/Window/getAttention @@ -3454,7 +3455,7 @@ /ja/docs/Web/API/window.confirm /ja/docs/Web/API/Window/confirm /ja/docs/Web/API/window.content /ja/docs/Web/API/Window/content /ja/docs/Web/API/window.controllers /ja/docs/Web/API/Window/controllers -/ja/docs/Web/API/window.crypto /ja/docs/Web/API/Window/crypto +/ja/docs/Web/API/window.crypto /ja/docs/Web/API/crypto_property /ja/docs/Web/API/window.defaultStatus /ja/docs/Web/API/Window/defaultStatus /ja/docs/Web/API/window.dialogArguments /ja/docs/Web/API/Window/dialogArguments /ja/docs/Web/API/window.directories /ja/docs/Web/API/Window/directories diff --git a/files/ja/_wikihistory.json b/files/ja/_wikihistory.json index aac2c96cd6..2c25b4aacb 100644 --- a/files/ja/_wikihistory.json +++ b/files/ja/_wikihistory.json @@ -24238,17 +24238,6 @@ "mfuji09" ] }, - "Web/API/Window/crypto": { - "modified": "2020-10-15T21:16:38.249Z", - "contributors": [ - "yumetodo", - "Marsf", - "fscholz", - "AshfaqHossain", - "ethertank", - "Potappo" - ] - }, "Web/API/Window/customElements": { "modified": "2020-10-15T22:08:55.255Z", "contributors": [ @@ -26260,6 +26249,17 @@ "silverskyvicto" ] }, + "Web/API/crypto_property": { + "modified": "2020-10-15T21:16:38.249Z", + "contributors": [ + "yumetodo", + "Marsf", + "fscholz", + "AshfaqHossain", + "ethertank", + "Potappo" + ] + }, "Web/API/fetch": { "modified": "2020-10-15T21:41:32.875Z", "contributors": [ diff --git a/files/ja/web/api/crypto_property/index.html b/files/ja/web/api/crypto_property/index.html new file mode 100644 index 0000000000..b503935598 --- /dev/null +++ b/files/ja/web/api/crypto_property/index.html @@ -0,0 +1,75 @@ +--- +title: window.crypto +slug: Web/API/crypto_property +tags: + - API + - HTML DOM + - Property + - Reference + - Window +translation_of: Web/API/Window/crypto +original_slug: Web/API/Window/crypto +--- +
{{APIRef}}
+ +

Window.crypto 読み取り専用プロパティは、グローバルオブジェクトに関連付けられた {{domxref("Crypto")}} オブジェクトを返します。このオブジェクトは、ウェブページが暗号に関連したサービスにアクセスできるようにします。 {{domxref("Window.crypto")}} プロパティ自体は読み取り専用ですが、そのメソッドすべて(加えて子オブジェクトのメソッドと {{domxref("SubtleCrypto")}} )は読み取り専用では有りません。故に polyfill による攻撃に対し脆弱です。

+ +

構文

+ +
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">The random numbers are: </p>
+<button type="button" onClick='genRandomNumbers()'>Generate 10 random numbers</button>
+ +

実行結果

+ +

{{ EmbedLiveSample('Example') }}

+ +

仕様

+ + + + + + + + + + + + + + +
仕様書策定状況備考
{{SpecName("Web Crypto API", "#dfn-GlobalCrypto", "Window.crypto")}}{{Spec2("Web Crypto API")}}初期定義
+ +

ブラウザーの実装状況

+ + + +

{{Compat("api.Window.crypto")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/window/crypto/index.html b/files/ja/web/api/window/crypto/index.html deleted file mode 100644 index daa31c46d2..0000000000 --- a/files/ja/web/api/window/crypto/index.html +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: window.crypto -slug: Web/API/Window/crypto -tags: - - API - - HTML DOM - - Property - - Reference - - Window -translation_of: Web/API/Window/crypto ---- -
{{APIRef}}
- -

Window.crypto 読み取り専用プロパティは、グローバルオブジェクトに関連付けられた {{domxref("Crypto")}} オブジェクトを返します。このオブジェクトは、ウェブページが暗号に関連したサービスにアクセスできるようにします。 {{domxref("Window.crypto")}} プロパティ自体は読み取り専用ですが、そのメソッドすべて(加えて子オブジェクトのメソッドと {{domxref("SubtleCrypto")}} )は読み取り専用では有りません。故に polyfill による攻撃に対し脆弱です。

- -

構文

- -
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">The random numbers are: </p>
-<button type="button" onClick='genRandomNumbers()'>Generate 10 random numbers</button>
- -

実行結果

- -

{{ EmbedLiveSample('Example') }}

- -

仕様

- - - - - - - - - - - - - - -
仕様書策定状況備考
{{SpecName("Web Crypto API", "#dfn-GlobalCrypto", "Window.crypto")}}{{Spec2("Web Crypto API")}}初期定義
- -

ブラウザーの実装状況

- - - -

{{Compat("api.Window.crypto")}}

- -

関連情報

- - diff --git a/files/ko/_redirects.txt b/files/ko/_redirects.txt index bd1fe5c87a..4a61a4ea44 100644 --- a/files/ko/_redirects.txt +++ b/files/ko/_redirects.txt @@ -491,6 +491,7 @@ /ko/docs/Web/API/WebGL_API/Using_shaders_to_apply_color_in_WebGL /ko/docs/Web/API/WebGL_API/Tutorial/Using_shaders_to_apply_color_in_WebGL /ko/docs/Web/API/WebGL_API/Using_textures_in_WebGL /ko/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL /ko/docs/Web/API/Web_Workers_API/basic_usage /ko/docs/Web/API/Web_Workers_API/Using_web_workers +/ko/docs/Web/API/Window/crypto /ko/docs/Web/API/crypto_property /ko/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout /ko/docs/Web/API/setTimeout /ko/docs/Web/API/WindowTimers/setTimeout /ko/docs/Web/API/setTimeout /ko/docs/Web/API/XMLHttpRequest/timeout /ko/docs/Web/API/XMLHttpRequest/timeout_event diff --git a/files/ko/_wikihistory.json b/files/ko/_wikihistory.json index 95562d5437..bf71955309 100644 --- a/files/ko/_wikihistory.json +++ b/files/ko/_wikihistory.json @@ -7213,13 +7213,6 @@ "alattalatta" ] }, - "Web/API/Window/crypto": { - "modified": "2020-10-15T21:40:03.517Z", - "contributors": [ - "alattalatta", - "hoony" - ] - }, "Web/API/Window/customElements": { "modified": "2020-10-15T22:26:45.848Z", "contributors": [ @@ -7630,6 +7623,13 @@ "Sebuls" ] }, + "Web/API/crypto_property": { + "modified": "2020-10-15T21:40:03.517Z", + "contributors": [ + "alattalatta", + "hoony" + ] + }, "Web/API/notification": { "modified": "2019-09-10T05:52:41.419Z", "contributors": [ diff --git a/files/ko/web/api/crypto_property/index.html b/files/ko/web/api/crypto_property/index.html new file mode 100644 index 0000000000..be31ca5888 --- /dev/null +++ b/files/ko/web/api/crypto_property/index.html @@ -0,0 +1,76 @@ +--- +title: Window.crypto +slug: Web/API/crypto_property +tags: + - API + - HTML DOM + - Property + - Reference + - Window +translation_of: Web/API/Window/crypto +original_slug: Web/API/Window/crypto +--- +
{{APIRef}}
+ +

Window.crypto속성은 전역 객체인 {{domxref("Crypto")}} 객체를 반환합니다. Crypto 객체는 웹 페이지가 특정 암호학적 서비스에 접근할 수 있는 경로입니다. crypto 속성 자체는 읽기 전용이지만, 모든 메서드(와 자식 객체 {{domxref("SubtleCrypto")}})의 메서드)는 읽기 전용이 아니므로 {{glossary("polyfill", "폴리필")}}을 통한 공격에 취약합니다.

+ +

구문

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

예제

+ +

다음 예제는 {{domxref("Window.crypto")}} 속성을 통해 {{domxref("Crypto.getRandomValues", "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">The random numbers are: </p>
+<button type="button" onClick='genRandomNumbers()'>Generate 10 random numbers</button>
+ +

결과

+ +

{{EmbedLiveSample('예제')}}

+ +

명세

+ + + + + + + + + + + + + + +
명세상태비고
{{SpecName("Web Crypto API", "#dfn-GlobalCrypto", "Window.crypto")}}{{Spec2("Web Crypto API")}}Initial definition
+ +

브라우저 호환성

+ + + +

{{Compat("api.Window.crypto")}}

+ +

같이 보기

+ + diff --git a/files/ko/web/api/window/crypto/index.html b/files/ko/web/api/window/crypto/index.html deleted file mode 100644 index 1b43534adc..0000000000 --- a/files/ko/web/api/window/crypto/index.html +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Window.crypto -slug: Web/API/Window/crypto -tags: - - API - - HTML DOM - - Property - - Reference - - Window -translation_of: Web/API/Window/crypto ---- -
{{APIRef}}
- -

Window.crypto속성은 전역 객체인 {{domxref("Crypto")}} 객체를 반환합니다. Crypto 객체는 웹 페이지가 특정 암호학적 서비스에 접근할 수 있는 경로입니다. crypto 속성 자체는 읽기 전용이지만, 모든 메서드(와 자식 객체 {{domxref("SubtleCrypto")}})의 메서드)는 읽기 전용이 아니므로 {{glossary("polyfill", "폴리필")}}을 통한 공격에 취약합니다.

- -

구문

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

예제

- -

다음 예제는 {{domxref("Window.crypto")}} 속성을 통해 {{domxref("Crypto.getRandomValues", "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">The random numbers are: </p>
-<button type="button" onClick='genRandomNumbers()'>Generate 10 random numbers</button>
- -

결과

- -

{{EmbedLiveSample('예제')}}

- -

명세

- - - - - - - - - - - - - - -
명세상태비고
{{SpecName("Web Crypto API", "#dfn-GlobalCrypto", "Window.crypto")}}{{Spec2("Web Crypto API")}}Initial definition
- -

브라우저 호환성

- - - -

{{Compat("api.Window.crypto")}}

- -

같이 보기

- - diff --git a/files/pl/_redirects.txt b/files/pl/_redirects.txt index 82c05c3816..d9d3d97538 100644 --- a/files/pl/_redirects.txt +++ b/files/pl/_redirects.txt @@ -443,7 +443,7 @@ /pl/docs/DOM/window.clearTimeout /pl/docs/Web/API/clearTimeout /pl/docs/DOM/window.closed /pl/docs/Web/API/Window/closed /pl/docs/DOM/window.controllers /pl/docs/Web/API/Window/controllers -/pl/docs/DOM/window.crypto /pl/docs/Web/API/Window/crypto +/pl/docs/DOM/window.crypto /pl/docs/Web/API/crypto_property /pl/docs/DOM/window.defaultStatus /pl/docs/Web/API/Window/defaultStatus /pl/docs/DOM/window.directories /pl/docs/Web/API/Window/directories /pl/docs/DOM/window.document /pl/docs/Web/API/Window/document @@ -675,7 +675,7 @@ /pl/docs/DOM:window.alert /pl/docs/Web/API/Window/alert /pl/docs/DOM:window.closed /pl/docs/Web/API/Window/closed /pl/docs/DOM:window.controllers /pl/docs/Web/API/Window/controllers -/pl/docs/DOM:window.crypto /pl/docs/Web/API/Window/crypto +/pl/docs/DOM:window.crypto /pl/docs/Web/API/crypto_property /pl/docs/DOM:window.defaultStatus /pl/docs/Web/API/Window/defaultStatus /pl/docs/DOM:window.directories /pl/docs/Web/API/Window/directories /pl/docs/DOM:window.document /pl/docs/Web/API/Window/document @@ -1503,6 +1503,7 @@ /pl/docs/Web/API/UIEvent/pageY /pl/docs/Web/API/MouseEvent/pageY /pl/docs/Web/API/Window/clearInterval /pl/docs/Web/API/clearInterval /pl/docs/Web/API/Window/clearTimeout /pl/docs/Web/API/clearTimeout +/pl/docs/Web/API/Window/crypto /pl/docs/Web/API/crypto_property /pl/docs/Web/API/Window/onload /pl/docs/Web/API/GlobalEventHandlers/onload /pl/docs/Web/API/Window/setInterval /pl/docs/Web/API/setInterval /pl/docs/Web/API/Window/setTimeout /pl/docs/Web/API/setTimeout diff --git a/files/pl/_wikihistory.json b/files/pl/_wikihistory.json index 331ae74307..09762278b7 100644 --- a/files/pl/_wikihistory.json +++ b/files/pl/_wikihistory.json @@ -3648,16 +3648,6 @@ "Internauta1024A" ] }, - "Web/API/Window/crypto": { - "modified": "2019-03-23T23:49:51.057Z", - "contributors": [ - "teoli", - "khalid32", - "Mgjbot", - "Ptak82", - "Internauta1024A" - ] - }, "Web/API/Window/defaultStatus": { "modified": "2019-03-23T23:49:46.875Z", "contributors": [ @@ -3924,6 +3914,16 @@ "qfel13" ] }, + "Web/API/crypto_property": { + "modified": "2019-03-23T23:49:51.057Z", + "contributors": [ + "teoli", + "khalid32", + "Mgjbot", + "Ptak82", + "Internauta1024A" + ] + }, "Web/API/setInterval": { "modified": "2019-03-24T00:10:09.408Z", "contributors": [ diff --git a/files/pl/web/api/crypto_property/index.html b/files/pl/web/api/crypto_property/index.html new file mode 100644 index 0000000000..35fdfbd173 --- /dev/null +++ b/files/pl/web/api/crypto_property/index.html @@ -0,0 +1,20 @@ +--- +title: window.crypto +slug: Web/API/crypto_property +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Window/crypto +original_slug: Web/API/Window/crypto +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca obiekt crypto przeglądarki, który może być wtedy użyty do manipulacji różnymi własnościami zabezpieczeń przeglądarki.

+

Zobacz więcej szczegółów o JavaScript crypto.

+

Specyfikacja

+

DOM Level 0. Nie jest częścią specyfikacji.

+
+  
+

{{ languages( { "en": "en/DOM/window.crypto", "ja": "ja/DOM/window.crypto" } ) }}

diff --git a/files/pl/web/api/window/crypto/index.html b/files/pl/web/api/window/crypto/index.html deleted file mode 100644 index 5d7bac8666..0000000000 --- a/files/pl/web/api/window/crypto/index.html +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: window.crypto -slug: Web/API/Window/crypto -tags: - - DOM - - Dokumentacja_Gecko_DOM - - Gecko - - Wszystkie_kategorie -translation_of: Web/API/Window/crypto ---- -

{{ ApiRef() }}

-

Podsumowanie

-

Zwraca obiekt crypto przeglądarki, który może być wtedy użyty do manipulacji różnymi własnościami zabezpieczeń przeglądarki.

-

Zobacz więcej szczegółów o JavaScript crypto.

-

Specyfikacja

-

DOM Level 0. Nie jest częścią specyfikacji.

-
-  
-

{{ languages( { "en": "en/DOM/window.crypto", "ja": "ja/DOM/window.crypto" } ) }}

diff --git a/files/pt-br/_redirects.txt b/files/pt-br/_redirects.txt index 8a590594f7..c9b2b0d8f6 100644 --- a/files/pt-br/_redirects.txt +++ b/files/pt-br/_redirects.txt @@ -539,6 +539,7 @@ /pt-BR/docs/Web/API/Window.navigator /pt-BR/docs/Web/API/Window/navigator /pt-BR/docs/Web/API/Window.openDialog /pt-BR/docs/Web/API/Window/openDialog /pt-BR/docs/Web/API/Window/Window.localStorage /pt-BR/docs/Web/API/Window/localStorage +/pt-BR/docs/Web/API/Window/crypto /pt-BR/docs/Web/API/crypto_property /pt-BR/docs/Web/API/Window/performance /pt-BR/docs/Web/API/performance_property /pt-BR/docs/Web/API/WindowBase64/atob /pt-BR/docs/Web/API/atob /pt-BR/docs/Web/API/WindowOrWorkerGlobalScope/atob /pt-BR/docs/Web/API/atob diff --git a/files/pt-br/_wikihistory.json b/files/pt-br/_wikihistory.json index 9bb010492b..e3285cd673 100644 --- a/files/pt-br/_wikihistory.json +++ b/files/pt-br/_wikihistory.json @@ -6643,13 +6643,6 @@ "fabreu" ] }, - "Web/API/Window/crypto": { - "modified": "2019-03-23T22:12:19.817Z", - "contributors": [ - "Hikashii", - "AlexandreBarros" - ] - }, "Web/API/Window/document": { "modified": "2019-03-23T22:49:44.918Z", "contributors": [ @@ -6996,6 +6989,13 @@ "Willkuns" ] }, + "Web/API/crypto_property": { + "modified": "2019-03-23T22:12:19.817Z", + "contributors": [ + "Hikashii", + "AlexandreBarros" + ] + }, "Web/API/fetch": { "modified": "2019-03-23T22:06:21.567Z", "contributors": [ diff --git a/files/pt-br/web/api/crypto_property/index.html b/files/pt-br/web/api/crypto_property/index.html new file mode 100644 index 0000000000..4c1139c94f --- /dev/null +++ b/files/pt-br/web/api/crypto_property/index.html @@ -0,0 +1,129 @@ +--- +title: Window.crypto +slug: Web/API/crypto_property +tags: + - API + - HTML DOM + - Janela + - NeedsCompatTable + - Propriedade + - Referencia + - Window +translation_of: Web/API/Window/crypto +original_slug: Web/API/Window/crypto +--- +
{{APIRef}}
+ +

{{domxref("Window.crypto")}} propriedade somente de leitura, devolve um objeto do tipo {{domxref("Crypto")}} associado ao objeto global. Este objeto permite que páginas da web utilizem recursos de criptografia.

+ +

Sintaxe

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

Exemplo

+ +

Usando a propriedade {{domxref("Window.crypto")}}  para acessar o método 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">The random numbers are: </p>
+<button type="button" onClick='genRandomNumbers()'>Generate 10 random numbers</button>
+ +

Resultado

+ +

{{ EmbedLiveSample('Example') }}

+ +

Especificações

+ + + + + + + + + + + + + + +
EspecificaçãoStatusComentário
{{SpecName("Web Crypto API", "#dfn-GlobalCrypto", "Window.crypto")}}{{Spec2("Web Crypto API")}}Definição inicial.
+ +

Compatibilidade com navegadores

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeEdgeFirefox (Gecko)Internet ExplorerEdgeOperaSafari
Suporte básico44 {{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}11 {{property_prefix("ms")}}2019{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
CaracterísticaChrome for AndroidEdgeFirefox MobileFirefox OSIE PhoneOpera MobileSafari Mobile
Suporte básico{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Veja também

+ + diff --git a/files/pt-br/web/api/window/crypto/index.html b/files/pt-br/web/api/window/crypto/index.html deleted file mode 100644 index 1ffbde5dfe..0000000000 --- a/files/pt-br/web/api/window/crypto/index.html +++ /dev/null @@ -1,128 +0,0 @@ ---- -title: Window.crypto -slug: Web/API/Window/crypto -tags: - - API - - HTML DOM - - Janela - - NeedsCompatTable - - Propriedade - - Referencia - - Window -translation_of: Web/API/Window/crypto ---- -
{{APIRef}}
- -

{{domxref("Window.crypto")}} propriedade somente de leitura, devolve um objeto do tipo {{domxref("Crypto")}} associado ao objeto global. Este objeto permite que páginas da web utilizem recursos de criptografia.

- -

Sintaxe

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

Exemplo

- -

Usando a propriedade {{domxref("Window.crypto")}}  para acessar o método 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">The random numbers are: </p>
-<button type="button" onClick='genRandomNumbers()'>Generate 10 random numbers</button>
- -

Resultado

- -

{{ EmbedLiveSample('Example') }}

- -

Especificações

- - - - - - - - - - - - - - -
EspecificaçãoStatusComentário
{{SpecName("Web Crypto API", "#dfn-GlobalCrypto", "Window.crypto")}}{{Spec2("Web Crypto API")}}Definição inicial.
- -

Compatibilidade com navegadores

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - - - - - -
CaracterísticaChromeEdgeFirefox (Gecko)Internet ExplorerEdgeOperaSafari
Suporte básico44 {{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}11 {{property_prefix("ms")}}2019{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
CaracterísticaChrome for AndroidEdgeFirefox MobileFirefox OSIE PhoneOpera MobileSafari Mobile
Suporte básico{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -

Veja também

- - diff --git a/files/ru/_redirects.txt b/files/ru/_redirects.txt index 342eec5f29..a7c155b7c0 100644 --- a/files/ru/_redirects.txt +++ b/files/ru/_redirects.txt @@ -368,6 +368,7 @@ /ru/docs/Web/API/WebGL_API/Using_shaders_to_apply_color_in_WebGL /ru/docs/Web/API/WebGL_API/Tutorial/Using_shaders_to_apply_color_in_WebGL /ru/docs/Web/API/WebRTC_API/протоколы /ru/docs/Web/API/WebRTC_API/Protocols /ru/docs/Web/API/WebRTC_API/связь /ru/docs/Web/API/WebRTC_API/Connectivity +/ru/docs/Web/API/Window/crypto /ru/docs/Web/API/crypto_property /ru/docs/Web/API/Window/mozAnimationStartTime /ru/docs/Web/API/Animation/startTime /ru/docs/Web/API/Window/performance /ru/docs/Web/API/performance_property /ru/docs/Web/API/WindowBase64/Base64_encoding_and_decoding /ru/docs/Glossary/Base64 diff --git a/files/ru/_wikihistory.json b/files/ru/_wikihistory.json index f71b8e7a70..23cc021d40 100644 --- a/files/ru/_wikihistory.json +++ b/files/ru/_wikihistory.json @@ -11199,12 +11199,6 @@ "AndreiSoroka" ] }, - "Web/API/Window/crypto": { - "modified": "2019-03-23T22:55:57.909Z", - "contributors": [ - "pinal" - ] - }, "Web/API/Window/devicePixelRatio": { "modified": "2020-10-15T21:52:27.387Z", "contributors": [ @@ -11905,6 +11899,12 @@ "andzion105" ] }, + "Web/API/crypto_property": { + "modified": "2019-03-23T22:55:57.909Z", + "contributors": [ + "pinal" + ] + }, "Web/API/fetch": { "modified": "2020-10-15T22:06:28.491Z", "contributors": [ diff --git a/files/ru/web/api/crypto_property/index.html b/files/ru/web/api/crypto_property/index.html new file mode 100644 index 0000000000..b0d9a3d849 --- /dev/null +++ b/files/ru/web/api/crypto_property/index.html @@ -0,0 +1,46 @@ +--- +title: Window.crypto +slug: Web/API/crypto_property +tags: + - API + - Нужно описание + - Нужны примеры + - Совместимость +translation_of: Web/API/Window/crypto +original_slug: Web/API/Window/crypto +--- +

{{APIRef}}

+ +

{{domxref("Window.crypto")}} даёт доступ к интерфейсу {{domxref("Crypto")}}. Этот интерфейс предоставляет веб-странице доступ к встроенным в браузер возможностям криптографии.

+ +

Синтаксис

+ +
var cryptoObj = window.crypto || window.msCrypto; // для IE 11
+
+ +

Спецификации

+ + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('Web Crypto API')}}{{Spec2('Web Crypto API')}}Стабильное API
+ +

Реализация в браузерах

+ +

{{Compat("api.Window.crypto")}}

+ +

Смотрите также

+ + diff --git a/files/ru/web/api/window/crypto/index.html b/files/ru/web/api/window/crypto/index.html deleted file mode 100644 index 29854ed7ce..0000000000 --- a/files/ru/web/api/window/crypto/index.html +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: Window.crypto -slug: Web/API/Window/crypto -tags: - - API - - Нужно описание - - Нужны примеры - - Совместимость -translation_of: Web/API/Window/crypto ---- -

{{APIRef}}

- -

{{domxref("Window.crypto")}} даёт доступ к интерфейсу {{domxref("Crypto")}}. Этот интерфейс предоставляет веб-странице доступ к встроенным в браузер возможностям криптографии.

- -

Синтаксис

- -
var cryptoObj = window.crypto || window.msCrypto; // для IE 11
-
- -

Спецификации

- - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('Web Crypto API')}}{{Spec2('Web Crypto API')}}Стабильное API
- -

Реализация в браузерах

- -

{{Compat("api.Window.crypto")}}

- -

Смотрите также

- - 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