From 4f4d511f3a78d7e3dc357e44481cf0a7eba99b9f Mon Sep 17 00:00:00 2001 From: MDN Date: Thu, 17 Mar 2022 00:12:44 +0000 Subject: [CRON] sync translated content --- files/fr/_redirects.txt | 1 + files/fr/_wikihistory.json | 2 +- .../web/api/serviceworker/onstatechange/index.md | 66 ----------------- .../api/serviceworker/statechange_event/index.md | 67 +++++++++++++++++ files/ja/_redirects.txt | 3 + files/ja/_wikihistory.json | 32 +++------ .../conflicting/web/http/headers/cookie/index.html | 58 +++++++++++++++ .../api/networkinformation/change_event/index.html | 59 +++++++++++++++ .../web/api/networkinformation/onchange/index.html | 58 --------------- files/ja/web/http/headers/cookie2/index.html | 57 --------------- files/ja/web/http/headers/set-cookie/index.html | 74 +++++++++++++++++++ files/ja/web/http/headers/set-cookie2/index.html | 73 ------------------- files/ko/_redirects.txt | 6 ++ files/ko/_wikihistory.json | 60 ++++++++-------- .../icegatheringstatechange_event/index.html | 77 ++++++++++++++++++++ .../connectionstatechange_event/index.html | 66 +++++++++++++++++ .../rtcpeerconnection/datachannel_event/index.html | 63 ++++++++++++++++ .../icecandidate_event/index.html | 64 +++++++++++++++++ .../onconnectionstatechange/index.html | 65 ----------------- .../api/rtcpeerconnection/ondatachannel/index.html | 62 ---------------- .../rtcpeerconnection/onicecandidate/index.html | 63 ---------------- .../onicegatheringstatechange/index.html | 76 -------------------- .../web/api/rtcpeerconnection/ontrack/index.html | 63 ---------------- .../api/rtcpeerconnection/track_event/index.html | 64 +++++++++++++++++ .../web/api/serviceworker/onstatechange/index.html | 72 ------------------- .../api/serviceworker/statechange_event/index.html | 73 +++++++++++++++++++ files/pt-br/_redirects.txt | 2 + files/pt-br/_wikihistory.json | 24 +++---- .../conflicting/web/http/headers/cookie/index.html | 59 +++++++++++++++ .../web/http/headers/set-cookie/index.html | 74 +++++++++++++++++++ files/pt-br/web/http/headers/cookie2/index.html | 58 --------------- .../pt-br/web/http/headers/set-cookie2/index.html | 73 ------------------- files/ru/_redirects.txt | 1 + files/ru/_wikihistory.json | 12 ++-- .../web/api/serviceworker/onstatechange/index.html | 60 ---------------- .../api/serviceworker/statechange_event/index.html | 61 ++++++++++++++++ files/zh-cn/_redirects.txt | 7 ++ files/zh-cn/_wikihistory.json | 84 +++++++++++----------- .../icecandidate_event/index.html | 66 +++++++++++++++++ .../conflicting/web/http/headers/cookie/index.html | 56 +++++++++++++++ .../web/http/headers/set-cookie/index.html | 71 ++++++++++++++++++ .../rtcpeerconnection/addstream_event/index.html | 54 ++++++++++++++ .../rtcpeerconnection/datachannel_event/index.html | 61 ++++++++++++++++ .../api/rtcpeerconnection/onaddstream/index.html | 53 -------------- .../api/rtcpeerconnection/ondatachannel/index.html | 60 ---------------- .../rtcpeerconnection/onicecandidate/index.html | 65 ----------------- .../web/api/rtcpeerconnection/ontrack/index.html | 56 --------------- .../api/rtcpeerconnection/track_event/index.html | 57 +++++++++++++++ .../web/api/serviceworker/onstatechange/index.html | 69 ------------------ .../api/serviceworker/statechange_event/index.html | 70 ++++++++++++++++++ files/zh-cn/web/http/headers/cookie2/index.html | 55 -------------- .../zh-cn/web/http/headers/set-cookie2/index.html | 70 ------------------ 52 files changed, 1416 insertions(+), 1386 deletions(-) delete mode 100644 files/fr/web/api/serviceworker/onstatechange/index.md create mode 100644 files/fr/web/api/serviceworker/statechange_event/index.md create mode 100644 files/ja/conflicting/web/http/headers/cookie/index.html create mode 100644 files/ja/web/api/networkinformation/change_event/index.html delete mode 100644 files/ja/web/api/networkinformation/onchange/index.html delete mode 100644 files/ja/web/http/headers/cookie2/index.html create mode 100644 files/ja/web/http/headers/set-cookie/index.html delete mode 100644 files/ja/web/http/headers/set-cookie2/index.html create mode 100644 files/ko/conflicting/web/api/rtcpeerconnection/icegatheringstatechange_event/index.html create mode 100644 files/ko/web/api/rtcpeerconnection/connectionstatechange_event/index.html create mode 100644 files/ko/web/api/rtcpeerconnection/datachannel_event/index.html create mode 100644 files/ko/web/api/rtcpeerconnection/icecandidate_event/index.html delete mode 100644 files/ko/web/api/rtcpeerconnection/onconnectionstatechange/index.html delete mode 100644 files/ko/web/api/rtcpeerconnection/ondatachannel/index.html delete mode 100644 files/ko/web/api/rtcpeerconnection/onicecandidate/index.html delete mode 100644 files/ko/web/api/rtcpeerconnection/onicegatheringstatechange/index.html delete mode 100644 files/ko/web/api/rtcpeerconnection/ontrack/index.html create mode 100644 files/ko/web/api/rtcpeerconnection/track_event/index.html delete mode 100644 files/ko/web/api/serviceworker/onstatechange/index.html create mode 100644 files/ko/web/api/serviceworker/statechange_event/index.html create mode 100644 files/pt-br/conflicting/web/http/headers/cookie/index.html create mode 100644 files/pt-br/conflicting/web/http/headers/set-cookie/index.html delete mode 100644 files/pt-br/web/http/headers/cookie2/index.html delete mode 100644 files/pt-br/web/http/headers/set-cookie2/index.html delete mode 100644 files/ru/web/api/serviceworker/onstatechange/index.html create mode 100644 files/ru/web/api/serviceworker/statechange_event/index.html create mode 100644 files/zh-cn/conflicting/web/api/rtcpeerconnection/icecandidate_event/index.html create mode 100644 files/zh-cn/conflicting/web/http/headers/cookie/index.html create mode 100644 files/zh-cn/conflicting/web/http/headers/set-cookie/index.html create mode 100644 files/zh-cn/web/api/rtcpeerconnection/addstream_event/index.html create mode 100644 files/zh-cn/web/api/rtcpeerconnection/datachannel_event/index.html delete mode 100644 files/zh-cn/web/api/rtcpeerconnection/onaddstream/index.html delete mode 100644 files/zh-cn/web/api/rtcpeerconnection/ondatachannel/index.html delete mode 100644 files/zh-cn/web/api/rtcpeerconnection/onicecandidate/index.html delete mode 100644 files/zh-cn/web/api/rtcpeerconnection/ontrack/index.html create mode 100644 files/zh-cn/web/api/rtcpeerconnection/track_event/index.html delete mode 100644 files/zh-cn/web/api/serviceworker/onstatechange/index.html create mode 100644 files/zh-cn/web/api/serviceworker/statechange_event/index.html delete mode 100644 files/zh-cn/web/http/headers/cookie2/index.html delete mode 100644 files/zh-cn/web/http/headers/set-cookie2/index.html diff --git a/files/fr/_redirects.txt b/files/fr/_redirects.txt index a5dcbf8334..a8bf44313e 100644 --- a/files/fr/_redirects.txt +++ b/files/fr/_redirects.txt @@ -3742,6 +3742,7 @@ /fr/docs/Web/API/SVGStylable /fr/docs/orphaned/Web/API/SVGStylable /fr/docs/Web/API/Selection.toString /fr/docs/Web/API/Selection/toString /fr/docs/Web/API/Selection_API /fr/docs/conflicting/Web/API/Selection +/fr/docs/Web/API/ServiceWorker/onstatechange /fr/docs/Web/API/ServiceWorker/statechange_event /fr/docs/Web/API/ServiceWorkerState /fr/docs/orphaned/Web/API/ServiceWorkerState /fr/docs/Web/API/SharedWorkerGlobalScope/onconnect /fr/docs/Web/API/SharedWorkerGlobalScope/connect_event /fr/docs/Web/API/Storage/LocalStorage /fr/docs/conflicting/Web/API/Window/localStorage diff --git a/files/fr/_wikihistory.json b/files/fr/_wikihistory.json index 4eb949802b..2f7310066a 100644 --- a/files/fr/_wikihistory.json +++ b/files/fr/_wikihistory.json @@ -19078,7 +19078,7 @@ "nobe4" ] }, - "Web/API/ServiceWorker/onstatechange": { + "Web/API/ServiceWorker/statechange_event": { "modified": "2019-03-23T22:37:05.749Z", "contributors": [ "nobe4" diff --git a/files/fr/web/api/serviceworker/onstatechange/index.md b/files/fr/web/api/serviceworker/onstatechange/index.md deleted file mode 100644 index f499cdf8bb..0000000000 --- a/files/fr/web/api/serviceworker/onstatechange/index.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: ServiceWorker.onstatechange -slug: Web/API/ServiceWorker/onstatechange -tags: - - API - - Propriété - - Reference -translation_of: Web/API/ServiceWorker/onstatechange ---- -{{SeeCompatTable}}{{APIRef("Service Workers API")}} - -Une propriété {{domxref("EventListener")}} appelée quand un évenement de type `statechange` est déclenché; c'est le cas dès que le {{domxref("ServiceWorker.state")}} change. - -## Syntax - - ServiceWorker.onstatechange = function(statechangeevent) { ... } - ServiceWorker.addEventListener('statechange', function(statechangeevent) { ... } ) - -## Examples - -Ce fragment de code présente [un exemple d'enregistrement d'évenements pour le service worker](https://github.com/GoogleChrome/samples/blob/gh-pages/service-worker/registration-events/index.html) ([démo live](https://googlechrome.github.io/samples/service-worker/registration-events/)). Le code écoute pour tout changement du {{domxref("ServiceWorker.state")}} et retourne sa valeur. - -```js -var serviceWorker; -if (registration.installing) { - serviceWorker = registration.installing; - document.querySelector('#kind').textContent = 'installé'; -} else if (registration.waiting) { - serviceWorker = registration.waiting; - document.querySelector('#kind').textContent = 'en attente'; -} else if (registration.active) { - serviceWorker = registration.active; - document.querySelector('#kind').textContent = 'actif'; -} - -if (serviceWorker) { - logState(serviceWorker.state); - serviceWorker.addEventListener('statechange', function(e) { - logState(e.target.state); - }); -} -``` - -Notez que quand l'évenement `statechange` est déclenché, la référence du service worker peut avoir changée. Par exemple : - -```js -navigator.serviceWorker.register(..).then(function(swr) { - swr.installing.state == "installé" - swr.installing.onstatechange = function() { - swr.installing == null; - // Ici, swr.waiting OU swr.active peuvent valoir true. Parce que l'évènement - // statechange est mis en queue, pendant que le worker sous jacent est peut être en - // état d'attente et sera immédiatement activé si possible. - } -}) -``` - -## Specifications - -| Spécification | État | Commentaire | -| -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | ------------------ | -| {{SpecName('Service Workers', '#service-worker-onstatechange-attribute', 'ServiceWorker.onstatechange')}} | {{Spec2('Service Workers')}} | Définition intiale | - -## Browser compatibility - -{{Compat("api.ServiceWorker.onstatechange")}} diff --git a/files/fr/web/api/serviceworker/statechange_event/index.md b/files/fr/web/api/serviceworker/statechange_event/index.md new file mode 100644 index 0000000000..0b84aeff07 --- /dev/null +++ b/files/fr/web/api/serviceworker/statechange_event/index.md @@ -0,0 +1,67 @@ +--- +title: ServiceWorker.onstatechange +slug: Web/API/ServiceWorker/statechange_event +tags: + - API + - Propriété + - Reference +translation_of: Web/API/ServiceWorker/onstatechange +original_slug: Web/API/ServiceWorker/onstatechange +--- +{{SeeCompatTable}}{{APIRef("Service Workers API")}} + +Une propriété {{domxref("EventListener")}} appelée quand un évenement de type `statechange` est déclenché; c'est le cas dès que le {{domxref("ServiceWorker.state")}} change. + +## Syntax + + ServiceWorker.onstatechange = function(statechangeevent) { ... } + ServiceWorker.addEventListener('statechange', function(statechangeevent) { ... } ) + +## Examples + +Ce fragment de code présente [un exemple d'enregistrement d'évenements pour le service worker](https://github.com/GoogleChrome/samples/blob/gh-pages/service-worker/registration-events/index.html) ([démo live](https://googlechrome.github.io/samples/service-worker/registration-events/)). Le code écoute pour tout changement du {{domxref("ServiceWorker.state")}} et retourne sa valeur. + +```js +var serviceWorker; +if (registration.installing) { + serviceWorker = registration.installing; + document.querySelector('#kind').textContent = 'installé'; +} else if (registration.waiting) { + serviceWorker = registration.waiting; + document.querySelector('#kind').textContent = 'en attente'; +} else if (registration.active) { + serviceWorker = registration.active; + document.querySelector('#kind').textContent = 'actif'; +} + +if (serviceWorker) { + logState(serviceWorker.state); + serviceWorker.addEventListener('statechange', function(e) { + logState(e.target.state); + }); +} +``` + +Notez que quand l'évenement `statechange` est déclenché, la référence du service worker peut avoir changée. Par exemple : + +```js +navigator.serviceWorker.register(..).then(function(swr) { + swr.installing.state == "installé" + swr.installing.onstatechange = function() { + swr.installing == null; + // Ici, swr.waiting OU swr.active peuvent valoir true. Parce que l'évènement + // statechange est mis en queue, pendant que le worker sous jacent est peut être en + // état d'attente et sera immédiatement activé si possible. + } +}) +``` + +## Specifications + +| Spécification | État | Commentaire | +| -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | ------------------ | +| {{SpecName('Service Workers', '#service-worker-onstatechange-attribute', 'ServiceWorker.onstatechange')}} | {{Spec2('Service Workers')}} | Définition intiale | + +## Browser compatibility + +{{Compat("api.ServiceWorker.onstatechange")}} diff --git a/files/ja/_redirects.txt b/files/ja/_redirects.txt index 249a98cdc6..2af45584f1 100644 --- a/files/ja/_redirects.txt +++ b/files/ja/_redirects.txt @@ -3217,6 +3217,7 @@ /ja/docs/Web/API/NavigatorOnLine/onLine /ja/docs/Web/API/Navigator/onLine /ja/docs/Web/API/NavigatorStorage /ja/docs/orphaned/Web/API/NavigatorStorage /ja/docs/Web/API/NavigatorStorage/storage /ja/docs/orphaned/Web/API/NavigatorStorage/storage +/ja/docs/Web/API/NetworkInformation/onchange /ja/docs/Web/API/NetworkInformation/change_event /ja/docs/Web/API/Node.appendChild /ja/docs/Web/API/Node/appendChild /ja/docs/Web/API/Node.attributes /ja/docs/Web/API/Element/attributes /ja/docs/Web/API/Node.baseURIObject /ja/docs/Web/API/Node @@ -4160,8 +4161,10 @@ /ja/docs/Web/HTTP/HTTP_access_control/Errors/CORSPreflightDidNotSucceed /ja/docs/Web/HTTP/CORS/Errors/CORSPreflightDidNotSucceed /ja/docs/Web/HTTP/HTTP_access_control/Errors/CORSRequestNotHttp /ja/docs/Web/HTTP/CORS/Errors/CORSRequestNotHttp /ja/docs/Web/HTTP/HTTP_response_codes /ja/docs/Web/HTTP/Status +/ja/docs/Web/HTTP/Headers/Cookie2 /ja/docs/conflicting/Web/HTTP/Headers/Cookie /ja/docs/Web/HTTP/Headers/Feature-Policy/vr /ja/docs/Web/HTTP/Headers/Feature-Policy/xr-spatial-tracking /ja/docs/Web/HTTP/Headers/Feature-Policy/xr /ja/docs/conflicting/Web/HTTP/Headers/Feature-Policy/xr-spatial-tracking +/ja/docs/Web/HTTP/Headers/Set-Cookie2 /ja/docs/Web/HTTP/Headers/Set-Cookie /ja/docs/Web/HTTP/Index /ja/docs/conflicting/Web/HTTP /ja/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_(PAC)_file /ja/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file /ja/docs/Web/HTTP/Response_codes /ja/docs/Web/HTTP/Status diff --git a/files/ja/_wikihistory.json b/files/ja/_wikihistory.json index 8898196d62..7c0aa15437 100644 --- a/files/ja/_wikihistory.json +++ b/files/ja/_wikihistory.json @@ -19022,14 +19022,14 @@ "jprichardson" ] }, - "Web/API/NetworkInformation/downlinkMax": { - "modified": "2019-03-23T22:28:25.185Z", + "Web/API/NetworkInformation/change_event": { + "modified": "2019-03-23T22:28:29.434Z", "contributors": [ "YuichiNukiyama" ] }, - "Web/API/NetworkInformation/onchange": { - "modified": "2019-03-23T22:28:29.434Z", + "Web/API/NetworkInformation/downlinkMax": { + "modified": "2019-03-23T22:28:25.185Z", "contributors": [ "YuichiNukiyama" ] @@ -35983,12 +35983,6 @@ "technohippy" ] }, - "Web/HTTP/Headers/Cookie2": { - "modified": "2020-10-15T22:08:54.618Z", - "contributors": [ - "silverskyvicto" - ] - }, "Web/HTTP/Headers/Cross-Origin-Resource-Policy": { "modified": "2020-10-15T22:28:41.646Z", "contributors": [ @@ -36284,12 +36278,8 @@ ] }, "Web/HTTP/Headers/Set-Cookie": { - "modified": "2020-10-15T22:09:30.260Z", + "modified": "2020-10-15T22:09:30.672Z", "contributors": [ - "pcw", - "mfuji09", - "maizuka", - "niusounds", "silverskyvicto" ] }, @@ -36300,12 +36290,6 @@ "silverskyvicto" ] }, - "Web/HTTP/Headers/Set-Cookie2": { - "modified": "2020-10-15T22:09:30.672Z", - "contributors": [ - "silverskyvicto" - ] - }, "Web/HTTP/Headers/SourceMap": { "modified": "2020-10-15T22:09:30.889Z", "contributors": [ @@ -48552,6 +48536,12 @@ "mfuji09" ] }, + "conflicting/Web/HTTP/Headers/Cookie": { + "modified": "2020-10-15T22:08:54.618Z", + "contributors": [ + "silverskyvicto" + ] + }, "conflicting/Web/HTTP/Headers/Feature-Policy/xr-spatial-tracking": { "modified": "2020-08-12T12:42:41.854Z", "contributors": [ diff --git a/files/ja/conflicting/web/http/headers/cookie/index.html b/files/ja/conflicting/web/http/headers/cookie/index.html new file mode 100644 index 0000000000..8bb97a8215 --- /dev/null +++ b/files/ja/conflicting/web/http/headers/cookie/index.html @@ -0,0 +1,58 @@ +--- +title: Cookie2 +slug: conflicting/Web/HTTP/Headers/Cookie +tags: + - HTTP + - Obsolete + - ヘッダー + - リクエスト + - リファレンス +translation_of: Web/HTTP/Headers/Cookie2 +original_slug: Web/HTTP/Headers/Cookie2 +--- +

{{HTTPSidebar}} {{obsolete_header}}

+ +

時代遅れの Cookie2 HTTP リクエストヘッダは、ユーザエージェントが "新しいスタイルの"クッキーを理解していることをサーバに知らせるために使われましたが、最近のユーザエージェントはこれではなく、 {{HTTPHeader("Cookie")}} ヘッダを使用します。

+ + + + + + + + + + + + +
ヘッダータイプ{{Glossary("Request header")}}
{{Glossary("Forbidden header name")}}yes
+ +

+ +
Cookie2: $Version="1"
+ +

仕様

+ + + + + + + + + + + + +
仕様タイトル
{{RFC("2965", "Cookie2")}}Historic specification of HTTP State Management Mechanism, obsoleted by {{RFC("6265")}}
+ +

ブラウザの実装状況

+ +

{{Compat("http.headers.Cookie2")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/networkinformation/change_event/index.html b/files/ja/web/api/networkinformation/change_event/index.html new file mode 100644 index 0000000000..926f813316 --- /dev/null +++ b/files/ja/web/api/networkinformation/change_event/index.html @@ -0,0 +1,59 @@ +--- +title: NetworkInformation.onchange +slug: Web/API/NetworkInformation/change_event +tags: + - API + - Event Handler + - Experimental + - Network Information API + - NetworkInformation + - Property + - Reference +translation_of: Web/API/NetworkInformation/onchange +original_slug: Web/API/NetworkInformation/onchange +--- +

{{apiref("Network Information API")}}{{SeeCompatTable}}

+ +

NetworkInformation.onchange イベントハンドラは、接続情報が変化したときに発火し、{{domxref("NetworkInformation")}} オブジェクトが {{event("change")}} を受け取るコードを含みます。

+ +

構文

+ +
netInfo.onchange = function() { ... }
+
+ +

+ +
// 接続型の取得
+var type = navigator.connection.type;
+
+function changeHandler(e) {
+   // ここで接続型の変更を操作する
+}
+
+// change イベントの登録:
+navigator.connection.onchange = changeHandler;
+
+// Another way: navigator.connection.addEventListener('change', changeHandler);
+ +

仕様

+ + + + + + + + + + + + + + + + +
仕様ステータスコメント
{{SpecName('Network Information')}}{{Spec2('Network Information')}}最初の定義
+ +

ブラウザ実装状況

+ +

{{Compat("api.NetworkInformation.onchange")}}

diff --git a/files/ja/web/api/networkinformation/onchange/index.html b/files/ja/web/api/networkinformation/onchange/index.html deleted file mode 100644 index f6c540bebe..0000000000 --- a/files/ja/web/api/networkinformation/onchange/index.html +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: NetworkInformation.onchange -slug: Web/API/NetworkInformation/onchange -tags: - - API - - Event Handler - - Experimental - - Network Information API - - NetworkInformation - - Property - - Reference -translation_of: Web/API/NetworkInformation/onchange ---- -

{{apiref("Network Information API")}}{{SeeCompatTable}}

- -

NetworkInformation.onchange イベントハンドラは、接続情報が変化したときに発火し、{{domxref("NetworkInformation")}} オブジェクトが {{event("change")}} を受け取るコードを含みます。

- -

構文

- -
netInfo.onchange = function() { ... }
-
- -

- -
// 接続型の取得
-var type = navigator.connection.type;
-
-function changeHandler(e) {
-   // ここで接続型の変更を操作する
-}
-
-// change イベントの登録:
-navigator.connection.onchange = changeHandler;
-
-// Another way: navigator.connection.addEventListener('change', changeHandler);
- -

仕様

- - - - - - - - - - - - - - - - -
仕様ステータスコメント
{{SpecName('Network Information')}}{{Spec2('Network Information')}}最初の定義
- -

ブラウザ実装状況

- -

{{Compat("api.NetworkInformation.onchange")}}

diff --git a/files/ja/web/http/headers/cookie2/index.html b/files/ja/web/http/headers/cookie2/index.html deleted file mode 100644 index 7f95c9941b..0000000000 --- a/files/ja/web/http/headers/cookie2/index.html +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: Cookie2 -slug: Web/HTTP/Headers/Cookie2 -tags: - - HTTP - - Obsolete - - ヘッダー - - リクエスト - - リファレンス -translation_of: Web/HTTP/Headers/Cookie2 ---- -

{{HTTPSidebar}} {{obsolete_header}}

- -

時代遅れの Cookie2 HTTP リクエストヘッダは、ユーザエージェントが "新しいスタイルの"クッキーを理解していることをサーバに知らせるために使われましたが、最近のユーザエージェントはこれではなく、 {{HTTPHeader("Cookie")}} ヘッダを使用します。

- - - - - - - - - - - - -
ヘッダータイプ{{Glossary("Request header")}}
{{Glossary("Forbidden header name")}}yes
- -

- -
Cookie2: $Version="1"
- -

仕様

- - - - - - - - - - - - -
仕様タイトル
{{RFC("2965", "Cookie2")}}Historic specification of HTTP State Management Mechanism, obsoleted by {{RFC("6265")}}
- -

ブラウザの実装状況

- -

{{Compat("http.headers.Cookie2")}}

- -

関連情報

- - diff --git a/files/ja/web/http/headers/set-cookie/index.html b/files/ja/web/http/headers/set-cookie/index.html new file mode 100644 index 0000000000..ca21a20bef --- /dev/null +++ b/files/ja/web/http/headers/set-cookie/index.html @@ -0,0 +1,74 @@ +--- +title: Set-Cookie2 +slug: Web/HTTP/Headers/Set-Cookie +tags: + - Cookies + - HTTP + - Obsolete + - ヘッダー + - リファレンス +translation_of: Web/HTTP/Headers/Set-Cookie2 +original_slug: Web/HTTP/Headers/Set-Cookie2 +--- +

{{HTTPSidebar}} {{obsolete_header}}

+ +

サーバーからユーザーエージェントにCookieを送信するために使用された古い Set-Cookie2 HTTP レスポンスヘッダーですが、仕様で廃止されました。代わりに {{HTTPHeader("Set-Cookie")}} を使用してください。

+ + + + + + + + + + + + +
ヘッダータイプ{{Glossary("Response header")}}
{{Glossary("Forbidden header name")}}いいえ
+ +

構文

+ +
Set-Cookie2: <cookie-name>=<cookie-value>
+Set-Cookie2: <cookie-name>=<cookie-value>; Comment=<value>
+Set-Cookie2: <cookie-name>=<cookie-value>; CommentURL=<http-url>
+Set-Cookie2: <cookie-name>=<cookie-value>; Discard
+Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>
+Set-Cookie2: <cookie-name>=<cookie-value>; Max-Age=<non-zero-digit>
+Set-Cookie2: <cookie-name>=<cookie-value>; Path=<path-value>
+Set-Cookie2: <cookie-name>=<cookie-value>; Port=<port-number>
+Set-Cookie2: <cookie-name>=<cookie-value>; Secure
+Set-Cookie2: <cookie-name>=<cookie-value>; Version=<version-number>
+
+// Multiple directives are also possible, for example:
+Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>; Secure
+
+// Multiple cookies are seperated by a comma
+Set-Cookie2: <cookie-name>=<cookie-value>, <cookie-name>=<cookie-value>, ...
+
+ +

仕様

+ + + + + + + + + + + + +
仕様書タイトル
{{RFC("2965", "Set-Cookie2")}}Historic specification of HTTP State Management Mechanism, obsoleted by {{RFC("6265")}}
+ +

ブラウザの互換性

+ +

{{Compat("http.headers.Set-Cookie2")}}

+ +

関連情報

+ + diff --git a/files/ja/web/http/headers/set-cookie2/index.html b/files/ja/web/http/headers/set-cookie2/index.html deleted file mode 100644 index c1485dec4a..0000000000 --- a/files/ja/web/http/headers/set-cookie2/index.html +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: Set-Cookie2 -slug: Web/HTTP/Headers/Set-Cookie2 -tags: - - Cookies - - HTTP - - Obsolete - - ヘッダー - - リファレンス -translation_of: Web/HTTP/Headers/Set-Cookie2 ---- -

{{HTTPSidebar}} {{obsolete_header}}

- -

サーバーからユーザーエージェントにCookieを送信するために使用された古い Set-Cookie2 HTTP レスポンスヘッダーですが、仕様で廃止されました。代わりに {{HTTPHeader("Set-Cookie")}} を使用してください。

- - - - - - - - - - - - -
ヘッダータイプ{{Glossary("Response header")}}
{{Glossary("Forbidden header name")}}いいえ
- -

構文

- -
Set-Cookie2: <cookie-name>=<cookie-value>
-Set-Cookie2: <cookie-name>=<cookie-value>; Comment=<value>
-Set-Cookie2: <cookie-name>=<cookie-value>; CommentURL=<http-url>
-Set-Cookie2: <cookie-name>=<cookie-value>; Discard
-Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>
-Set-Cookie2: <cookie-name>=<cookie-value>; Max-Age=<non-zero-digit>
-Set-Cookie2: <cookie-name>=<cookie-value>; Path=<path-value>
-Set-Cookie2: <cookie-name>=<cookie-value>; Port=<port-number>
-Set-Cookie2: <cookie-name>=<cookie-value>; Secure
-Set-Cookie2: <cookie-name>=<cookie-value>; Version=<version-number>
-
-// Multiple directives are also possible, for example:
-Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>; Secure
-
-// Multiple cookies are seperated by a comma
-Set-Cookie2: <cookie-name>=<cookie-value>, <cookie-name>=<cookie-value>, ...
-
- -

仕様

- - - - - - - - - - - - -
仕様書タイトル
{{RFC("2965", "Set-Cookie2")}}Historic specification of HTTP State Management Mechanism, obsoleted by {{RFC("6265")}}
- -

ブラウザの互換性

- -

{{Compat("http.headers.Set-Cookie2")}}

- -

関連情報

- - diff --git a/files/ko/_redirects.txt b/files/ko/_redirects.txt index 80407fb56b..c4b68910cb 100644 --- a/files/ko/_redirects.txt +++ b/files/ko/_redirects.txt @@ -488,6 +488,11 @@ /ko/docs/Web/API/Position /ko/docs/Web/API/GeolocationPosition /ko/docs/Web/API/PositionOptions /ko/docs/Web/API/Geolocation/getCurrentPosition /ko/docs/Web/API/RTCConfiguration /ko/docs/Web/API/RTCPeerConnection/RTCPeerConnection +/ko/docs/Web/API/RTCPeerConnection/onconnectionstatechange /ko/docs/Web/API/RTCPeerConnection/connectionstatechange_event +/ko/docs/Web/API/RTCPeerConnection/ondatachannel /ko/docs/Web/API/RTCPeerConnection/datachannel_event +/ko/docs/Web/API/RTCPeerConnection/onicecandidate /ko/docs/Web/API/RTCPeerConnection/icecandidate_event +/ko/docs/Web/API/RTCPeerConnection/onicegatheringstatechange /ko/docs/conflicting/Web/API/RTCPeerConnection/icegatheringstatechange_event +/ko/docs/Web/API/RTCPeerConnection/ontrack /ko/docs/Web/API/RTCPeerConnection/track_event /ko/docs/Web/API/RandomSource /ko/docs/Web/API/Crypto/getRandomValues /ko/docs/Web/API/RandomSource/getRandomValues /ko/docs/Web/API/Crypto/getRandomValues /ko/docs/Web/API/Screen.lockOrientation /ko/docs/Web/API/Screen/lockOrientation @@ -497,6 +502,7 @@ /ko/docs/Web/API/Screen.orientation /ko/docs/Web/API/Screen/orientation /ko/docs/Web/API/Screen.orientation/window.screen.orientation /ko/docs/Web/API/Screen/orientation /ko/docs/Web/API/Screen/onorientationchange /ko/docs/Web/API/Screen/orientationchange_event +/ko/docs/Web/API/ServiceWorker/onstatechange /ko/docs/Web/API/ServiceWorker/statechange_event /ko/docs/Web/API/Streams_API/컨셉 /ko/docs/Web/API/Streams_API/Concepts /ko/docs/Web/API/WebGL_API/Adding_2D_content_to_a_WebGL_context /ko/docs/Web/API/WebGL_API/Tutorial/Adding_2D_content_to_a_WebGL_context /ko/docs/Web/API/WebGL_API/Animating_objects_with_WebGL /ko/docs/Web/API/WebGL_API/Tutorial/Animating_objects_with_WebGL diff --git a/files/ko/_wikihistory.json b/files/ko/_wikihistory.json index b811cae08e..adbd504fa9 100644 --- a/files/ko/_wikihistory.json +++ b/files/ko/_wikihistory.json @@ -6127,6 +6127,12 @@ "chansbro" ] }, + "Web/API/RTCPeerConnection/connectionstatechange_event": { + "modified": "2020-10-15T22:21:46.935Z", + "contributors": [ + "chansbro" + ] + }, "Web/API/RTCPeerConnection/createAnswer": { "modified": "2020-10-15T22:21:52.646Z", "contributors": [ @@ -6151,6 +6157,12 @@ "chansbro" ] }, + "Web/API/RTCPeerConnection/datachannel_event": { + "modified": "2020-10-15T22:21:38.724Z", + "contributors": [ + "chansbro" + ] + }, "Web/API/RTCPeerConnection/generateCertificate": { "modified": "2020-10-15T22:22:01.110Z", "contributors": [ @@ -6193,44 +6205,20 @@ "chansbro" ] }, - "Web/API/RTCPeerConnection/icegatheringstatechange_event": { - "modified": "2020-10-15T22:21:34.594Z", - "contributors": [ - "chansbro" - ] - }, - "Web/API/RTCPeerConnection/localDescription": { - "modified": "2020-10-15T22:22:06.987Z", - "contributors": [ - "chansbro" - ] - }, - "Web/API/RTCPeerConnection/onconnectionstatechange": { - "modified": "2020-10-15T22:21:46.935Z", - "contributors": [ - "chansbro" - ] - }, - "Web/API/RTCPeerConnection/ondatachannel": { - "modified": "2020-10-15T22:21:38.724Z", - "contributors": [ - "chansbro" - ] - }, - "Web/API/RTCPeerConnection/onicecandidate": { + "Web/API/RTCPeerConnection/icecandidate_event": { "modified": "2020-10-15T22:21:32.954Z", "contributors": [ "chansbro" ] }, - "Web/API/RTCPeerConnection/onicegatheringstatechange": { - "modified": "2020-10-15T22:21:36.115Z", + "Web/API/RTCPeerConnection/icegatheringstatechange_event": { + "modified": "2020-10-15T22:21:34.594Z", "contributors": [ "chansbro" ] }, - "Web/API/RTCPeerConnection/ontrack": { - "modified": "2020-10-15T22:22:07.343Z", + "Web/API/RTCPeerConnection/localDescription": { + "modified": "2020-10-15T22:22:06.987Z", "contributors": [ "chansbro" ] @@ -6266,6 +6254,12 @@ "chansbro" ] }, + "Web/API/RTCPeerConnection/track_event": { + "modified": "2020-10-15T22:22:07.343Z", + "contributors": [ + "chansbro" + ] + }, "Web/API/RTCPeerConnectionIceEvent": { "modified": "2020-10-15T22:21:34.761Z", "contributors": [ @@ -6420,7 +6414,7 @@ "minias" ] }, - "Web/API/ServiceWorker/onstatechange": { + "Web/API/ServiceWorker/statechange_event": { "modified": "2020-10-15T22:20:48.975Z", "contributors": [ "dragmove" @@ -17502,6 +17496,12 @@ "chansbro" ] }, + "conflicting/Web/API/RTCPeerConnection/icegatheringstatechange_event": { + "modified": "2020-10-15T22:21:36.115Z", + "contributors": [ + "chansbro" + ] + }, "conflicting/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL": { "modified": "2019-03-23T22:54:05.275Z", "contributors": [ diff --git a/files/ko/conflicting/web/api/rtcpeerconnection/icegatheringstatechange_event/index.html b/files/ko/conflicting/web/api/rtcpeerconnection/icegatheringstatechange_event/index.html new file mode 100644 index 0000000000..c63e0af02f --- /dev/null +++ b/files/ko/conflicting/web/api/rtcpeerconnection/icegatheringstatechange_event/index.html @@ -0,0 +1,77 @@ +--- +title: RTCPeerConnection.onicegatheringstatechange +slug: conflicting/Web/API/RTCPeerConnection/icegatheringstatechange_event +translation_of: Web/API/RTCPeerConnection/onicegatheringstatechange +original_slug: Web/API/RTCPeerConnection/onicegatheringstatechange +--- +

{{APIRef("WebRTC")}}{{SeeCompatTable}}

+ +

RTCPeerConnection.onicegatheringstatechange속성은 {{event("icegatheringstatechange")}} 이벤트가 {{domxref("RTCPeerConnection")}}에 전달될 때 호출이되는 함수를 정의하는 {{event("Event_handlers", "event handler")}}입니다. 이이벤트는 ICE 에이전트가 ICE candidate를 수집을 하는지의 여부를 알려주는 ICE 수집 상태가 변하면 발생합니다. 하지만, ICE 수집 상태를 모니터링 해야하는 특별한 이유가 없으면 이 이벤트를 감시 할 필요는 없습니다.

+ +

Syntax

+ +
RTCPeerConnection.onicegatheringstatechange = eventHandler;
+
+ +

+ +

{{event("icegatheringstatechange")}} 이벤트를 가진 {{domxref("Event")}} 객체를 단일 패러미터로 전달하는 함수를 제공합니다. {{domxref("RTCPeerConnection.iceGatheringState")}} 속성의 값 확인을 통해 ICE 수집 상태를 새로운 값으로 변경이 가능합니다.

+ +

예시

+ +

아래의 예제는 {{domxref("RTCPeerConnection.iceGatheringState", "iceGatheringState")}} 속성 값이 변할 때마다 현재 값을 확인하고, 수집 상태 변화에 맞추어 표시될 상태 내용을 업데이트해서 유저에게 알려줍니다.  

+ +

이 상태는 {{HTMLElement("div")}} 요소에 텍스트로 표시됩니다.

+ +
<div id="iceStatus"></div>
+
+ +

예제에 사용된 이벤트 핸들러는 아래와 같습니다:

+ +
pc.onicegatheringstatechange = function() {
+  let label = "Unknown";
+
+  switch(pc.iceGatheringState) {
+    case "new":
+    case "complete":
+      label = "Idle";
+      break;
+    case "gathering":
+      label = "Determining route";
+      break;
+  }
+  // HTML에서 id가 "iceStatus"인 요소에 label 값을 지정
+  document.getElementById("iceStatus").innerHTML = label;
+}
+ +

명세

+ + + + + + + + + + + + + + + + +
명세상태코멘트
{{ SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-onicegatheringstatechange', 'RTCPeerConnection.onicegatheringstatechange') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
+ +

브라우저 호환성

+ + + +

{{Compat("api.RTCPeerConnection.onicegatheringstatechange")}}

+ +

참조

+ + diff --git a/files/ko/web/api/rtcpeerconnection/connectionstatechange_event/index.html b/files/ko/web/api/rtcpeerconnection/connectionstatechange_event/index.html new file mode 100644 index 0000000000..3547500e7b --- /dev/null +++ b/files/ko/web/api/rtcpeerconnection/connectionstatechange_event/index.html @@ -0,0 +1,66 @@ +--- +title: RTCPeerConnection.onconnectionstatechange +slug: Web/API/RTCPeerConnection/connectionstatechange_event +translation_of: Web/API/RTCPeerConnection/onconnectionstatechange +original_slug: Web/API/RTCPeerConnection/onconnectionstatechange +--- +

{{APIRef("WebRTC")}}

+ +

RTCPeerConnection.onconnectionstatechange 속성에 {{domxref("RTCPeerConnection")}} 인스턴스에서 발생하는 {{event("connectionstatechange")}} 이벤트를 처리하기 위해 호출되는 {{event("Event_handlers", "event handler")}}를 정의하게됩니다. 이 이벤트는  연결의 상태 집합체가 변할 때마다 발생합니다. 이 상태 집합체는 연결에 의해 사용되는 각각의 네트워크 전송 상태들의 묶음입니다.

+ +

Syntax

+ +
RTCPeerConnection.onconnectionstatechange = eventHandler;
+
+ +

+ +

{{domxref("RTCPeerConnection")}}에서 {{event("connectionstatechange")}} 이벤트가 생길 때, 브라우저에 의해 호출되는 함수입니다. 이 함수는 {{domxref("Event")}} 타입의 객체인 단일 패러미터를 입력인자로 받습니다. 해당 이벤트 객체는 특별한 정보를 담고 있지는 않습니다. 새로운 상태를 확인하려면 피어 연결의 {{domxref("RTCPeerConnection.connectionState", "connectionState")}}에 해당하는 값을 살펴보십시오. 

+ +

예시

+ +
pc.onconnectionstatechange = function(event) {
+  switch(pc.connectionState) {
+    case "connected":
+      // The connection has become fully connected
+      break;
+    case "disconnected":
+    case "failed":
+      // One or more transports has terminated unexpectedly or in an error
+      break;
+    case "closed":
+      // The connection has been closed
+      break;
+  }
+}
+ +

명세

+ + + + + + + + + + + + + + + + +
명세상태코멘트
{{ SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-onconnectionstatechange', 'RTCPeerConnection.onconnectionstatechange') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
+ +

브라우저 호환성

+ + + +

{{Compat("api.RTCPeerConnection.onconnectionstatechange")}}

+ +

참조

+ + diff --git a/files/ko/web/api/rtcpeerconnection/datachannel_event/index.html b/files/ko/web/api/rtcpeerconnection/datachannel_event/index.html new file mode 100644 index 0000000000..706ebca78f --- /dev/null +++ b/files/ko/web/api/rtcpeerconnection/datachannel_event/index.html @@ -0,0 +1,63 @@ +--- +title: RTCPeerConnection.ondatachannel +slug: Web/API/RTCPeerConnection/datachannel_event +translation_of: Web/API/RTCPeerConnection/ondatachannel +original_slug: Web/API/RTCPeerConnection/ondatachannel +--- +

{{APIRef("WebRTC")}}{{SeeCompatTable}}

+ +

RTCPeerConnection.ondatachannel 속성은 {{domxref("RTCPeerConnection")}}에서 발생하는 {{event("datachannel")}} 이벤트에 의해 호출되는 {{event("Event_handlers", "event handler")}}입니다. 이 속성에는 함수를 정의하게됩니다. {{domxref("RTCDataChannelEvent")}}의 한 종류인 이 이벤트는 원격 유저가 {{domxref("RTCPeerConnection.createDataChannel", "createDataChannel()")}}를 호출해서 연결에 {{domxref("RTCDataChannel")}}가 추가되었을 때, 전달됩니다. 

+ +

이 이벤트를 수신하게되는 시점에서는 {{domxref("RTCDataChannel")}}가 아직 열리지 않았을 수 있습니다. 사용하기 전에 꼭 신규 RTCDataChannel"open"이벤트가 발생하는 것을 확인하십시오.

+ +

Syntax

+ +
RTCPeerConnection.ondatachannel = function;
+
+ +

+ +

이 속성에 지정하는 함수는 단일 패러미터를 입력 인자로 받습니다. channel 속성에 생성된 {{domxref("RTCDataChannel")}}를 제공하는 {{domxref("RTCDataChannelEvent")}} 입니다. 

+ +

예시

+ +
pc.ondatachannel = function(ev) {
+  console.log('Data channel is created!');
+  ev.channel.onopen = function() {
+    console.log('Data channel is open and ready to be used.');
+  };
+};
+
+ +

명세

+ + + + + + + + + + + + + + + + +
명세상태코멘트
{{ SpecName('WebRTC 1.0', '#dom-rtcpeerconnection-ondatachannel', 'RTCPeerConnection.ondatachannel') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
+ +

브라우저 호환성

+ + + +

{{Compat("api.RTCPeerConnection.ondatachannel")}}

+ +

참조

+ + diff --git a/files/ko/web/api/rtcpeerconnection/icecandidate_event/index.html b/files/ko/web/api/rtcpeerconnection/icecandidate_event/index.html new file mode 100644 index 0000000000..4a74784411 --- /dev/null +++ b/files/ko/web/api/rtcpeerconnection/icecandidate_event/index.html @@ -0,0 +1,64 @@ +--- +title: RTCPeerConnection.onicecandidate +slug: Web/API/RTCPeerConnection/icecandidate_event +translation_of: Web/API/RTCPeerConnection/onicecandidate +original_slug: Web/API/RTCPeerConnection/onicecandidate +--- +

{{APIRef("WebRTC")}}

+ +

 RTCPeerConnection 속성의 {{domxref("RTCPeerConnection.onicecandidate", "onicecandidate")}} 는 {{domxref("RTCPeerConnection")}} 인스턴스에서 {{event("icecandidate")}} 이벤트 발생시에 호출 하려는 함수를 지정합니다. 이 이벤트는 로컬 {{Glossary("ICE")}} 에이전트가 signaling 서버를 통해 원격 피어에게 메세지를 전달 할 필요가 있을때 마다 발생합니다. 그리고 ICE 에이전트가 signaling에 사용되는 기술에 대한 구체사항을 모르더라도 원격 피어와의 네고시에이션을 수행하도록 도와줍니다. 어떤 메세징 기술을 선택하던간에, 이 메소드를 사용해서 원격 피어에 ICE candidate를 전달하는 과정을 간단하게 구현 할 수 있습니다. 

+ +

Syntax

+ +
RTCPeerConnection.onicecandidate = eventHandler;
+
+ +

+ +

onicecandidate 속성은 {{event("icecandidate")}} 이벤트를 나타내는 {{domxref("RTCPeerConnectionIceEvent")}} 객체를 입력 값으로 받는 함수로 설정되어야합니다. 여기에 설정되는 함수는 ICE candidate를 signaling 서버를 통해 원격 피어에게 전달해야합니다. 이때, ICE candidate의 {{Glossary("SDP")}}는 이벤트의 {{domxref("RTCPeerConnectionIceEvent.candidate", "candidate")}} 속성에서 확인 할 수 있습니다. 만약 이벤트의 candidate 속성이 null로 지정되어있다면, ICE 수집과정이 완료됩니다. 이 메세지는 원격 피어에 전달되지 않아야합니다. 이때, 연결의 {{domxref("RTCPeerConnection.iceGatheringState", "iceGatheringState")}} 또한 complete로 바뀌게 됩니다. ICE 수집 상태를 명시적으로 감시할 필요는 없습니다. 다만, signaling의 종료를 감지해야 한다면, ICE 네고시에이션이 complete 상태로 변한것을 알려주는 {{domxref("RTCPeerConnection.icegatheringstatechange_event", "icegatheringstatechange")}} 이벤트를 감시하면 됩니다.

+ +

예시

+ +

아래는 Signaling and video calling 문서의 코드를 기반으로 원격 피어에게 ICE candidate를 전달하는 {{event("icecandidate")}} 이벤트에 대한 핸들러를 설정합니다.

+ +
pc.onicecandidate = function(event) {
+  if (event.candidate) {
+    // event.candidate가 존재하면 원격 유저에게 candidate를 전달합니다.
+  } else {
+    // 모든 ICE candidate가 원격 유저에게 전달된 조건에서 실행됩니다.
+    // candidate = null
+  }
+}
+ +

위에서 알 수 있듯이, 이벤트의 {{domxref("RTCPeerConnectionIceEvent.candidate", "candidate")}} 속성이 null이면 네고시에이션의 종료가 감지됩니다. 

+ +

명세

+ + + + + + + + + + + + + + + + +
명세상태코멘트
{{ SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-onicecandidate', 'RTCPeerConnection.onicecandidate') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
+ +

브라우저 호환성

+ + + +

{{Compat("api.RTCPeerConnection.onicecandidate")}}

+ +

참조

+ + diff --git a/files/ko/web/api/rtcpeerconnection/onconnectionstatechange/index.html b/files/ko/web/api/rtcpeerconnection/onconnectionstatechange/index.html deleted file mode 100644 index a152ddf080..0000000000 --- a/files/ko/web/api/rtcpeerconnection/onconnectionstatechange/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: RTCPeerConnection.onconnectionstatechange -slug: Web/API/RTCPeerConnection/onconnectionstatechange -translation_of: Web/API/RTCPeerConnection/onconnectionstatechange ---- -

{{APIRef("WebRTC")}}

- -

RTCPeerConnection.onconnectionstatechange 속성에 {{domxref("RTCPeerConnection")}} 인스턴스에서 발생하는 {{event("connectionstatechange")}} 이벤트를 처리하기 위해 호출되는 {{event("Event_handlers", "event handler")}}를 정의하게됩니다. 이 이벤트는  연결의 상태 집합체가 변할 때마다 발생합니다. 이 상태 집합체는 연결에 의해 사용되는 각각의 네트워크 전송 상태들의 묶음입니다.

- -

Syntax

- -
RTCPeerConnection.onconnectionstatechange = eventHandler;
-
- -

- -

{{domxref("RTCPeerConnection")}}에서 {{event("connectionstatechange")}} 이벤트가 생길 때, 브라우저에 의해 호출되는 함수입니다. 이 함수는 {{domxref("Event")}} 타입의 객체인 단일 패러미터를 입력인자로 받습니다. 해당 이벤트 객체는 특별한 정보를 담고 있지는 않습니다. 새로운 상태를 확인하려면 피어 연결의 {{domxref("RTCPeerConnection.connectionState", "connectionState")}}에 해당하는 값을 살펴보십시오. 

- -

예시

- -
pc.onconnectionstatechange = function(event) {
-  switch(pc.connectionState) {
-    case "connected":
-      // The connection has become fully connected
-      break;
-    case "disconnected":
-    case "failed":
-      // One or more transports has terminated unexpectedly or in an error
-      break;
-    case "closed":
-      // The connection has been closed
-      break;
-  }
-}
- -

명세

- - - - - - - - - - - - - - - - -
명세상태코멘트
{{ SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-onconnectionstatechange', 'RTCPeerConnection.onconnectionstatechange') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
- -

브라우저 호환성

- - - -

{{Compat("api.RTCPeerConnection.onconnectionstatechange")}}

- -

참조

- - diff --git a/files/ko/web/api/rtcpeerconnection/ondatachannel/index.html b/files/ko/web/api/rtcpeerconnection/ondatachannel/index.html deleted file mode 100644 index e93e2e4f14..0000000000 --- a/files/ko/web/api/rtcpeerconnection/ondatachannel/index.html +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: RTCPeerConnection.ondatachannel -slug: Web/API/RTCPeerConnection/ondatachannel -translation_of: Web/API/RTCPeerConnection/ondatachannel ---- -

{{APIRef("WebRTC")}}{{SeeCompatTable}}

- -

RTCPeerConnection.ondatachannel 속성은 {{domxref("RTCPeerConnection")}}에서 발생하는 {{event("datachannel")}} 이벤트에 의해 호출되는 {{event("Event_handlers", "event handler")}}입니다. 이 속성에는 함수를 정의하게됩니다. {{domxref("RTCDataChannelEvent")}}의 한 종류인 이 이벤트는 원격 유저가 {{domxref("RTCPeerConnection.createDataChannel", "createDataChannel()")}}를 호출해서 연결에 {{domxref("RTCDataChannel")}}가 추가되었을 때, 전달됩니다. 

- -

이 이벤트를 수신하게되는 시점에서는 {{domxref("RTCDataChannel")}}가 아직 열리지 않았을 수 있습니다. 사용하기 전에 꼭 신규 RTCDataChannel"open"이벤트가 발생하는 것을 확인하십시오.

- -

Syntax

- -
RTCPeerConnection.ondatachannel = function;
-
- -

- -

이 속성에 지정하는 함수는 단일 패러미터를 입력 인자로 받습니다. channel 속성에 생성된 {{domxref("RTCDataChannel")}}를 제공하는 {{domxref("RTCDataChannelEvent")}} 입니다. 

- -

예시

- -
pc.ondatachannel = function(ev) {
-  console.log('Data channel is created!');
-  ev.channel.onopen = function() {
-    console.log('Data channel is open and ready to be used.');
-  };
-};
-
- -

명세

- - - - - - - - - - - - - - - - -
명세상태코멘트
{{ SpecName('WebRTC 1.0', '#dom-rtcpeerconnection-ondatachannel', 'RTCPeerConnection.ondatachannel') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
- -

브라우저 호환성

- - - -

{{Compat("api.RTCPeerConnection.ondatachannel")}}

- -

참조

- - diff --git a/files/ko/web/api/rtcpeerconnection/onicecandidate/index.html b/files/ko/web/api/rtcpeerconnection/onicecandidate/index.html deleted file mode 100644 index a8c23acfc1..0000000000 --- a/files/ko/web/api/rtcpeerconnection/onicecandidate/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: RTCPeerConnection.onicecandidate -slug: Web/API/RTCPeerConnection/onicecandidate -translation_of: Web/API/RTCPeerConnection/onicecandidate ---- -

{{APIRef("WebRTC")}}

- -

 RTCPeerConnection 속성의 {{domxref("RTCPeerConnection.onicecandidate", "onicecandidate")}} 는 {{domxref("RTCPeerConnection")}} 인스턴스에서 {{event("icecandidate")}} 이벤트 발생시에 호출 하려는 함수를 지정합니다. 이 이벤트는 로컬 {{Glossary("ICE")}} 에이전트가 signaling 서버를 통해 원격 피어에게 메세지를 전달 할 필요가 있을때 마다 발생합니다. 그리고 ICE 에이전트가 signaling에 사용되는 기술에 대한 구체사항을 모르더라도 원격 피어와의 네고시에이션을 수행하도록 도와줍니다. 어떤 메세징 기술을 선택하던간에, 이 메소드를 사용해서 원격 피어에 ICE candidate를 전달하는 과정을 간단하게 구현 할 수 있습니다. 

- -

Syntax

- -
RTCPeerConnection.onicecandidate = eventHandler;
-
- -

- -

onicecandidate 속성은 {{event("icecandidate")}} 이벤트를 나타내는 {{domxref("RTCPeerConnectionIceEvent")}} 객체를 입력 값으로 받는 함수로 설정되어야합니다. 여기에 설정되는 함수는 ICE candidate를 signaling 서버를 통해 원격 피어에게 전달해야합니다. 이때, ICE candidate의 {{Glossary("SDP")}}는 이벤트의 {{domxref("RTCPeerConnectionIceEvent.candidate", "candidate")}} 속성에서 확인 할 수 있습니다. 만약 이벤트의 candidate 속성이 null로 지정되어있다면, ICE 수집과정이 완료됩니다. 이 메세지는 원격 피어에 전달되지 않아야합니다. 이때, 연결의 {{domxref("RTCPeerConnection.iceGatheringState", "iceGatheringState")}} 또한 complete로 바뀌게 됩니다. ICE 수집 상태를 명시적으로 감시할 필요는 없습니다. 다만, signaling의 종료를 감지해야 한다면, ICE 네고시에이션이 complete 상태로 변한것을 알려주는 {{domxref("RTCPeerConnection.icegatheringstatechange_event", "icegatheringstatechange")}} 이벤트를 감시하면 됩니다.

- -

예시

- -

아래는 Signaling and video calling 문서의 코드를 기반으로 원격 피어에게 ICE candidate를 전달하는 {{event("icecandidate")}} 이벤트에 대한 핸들러를 설정합니다.

- -
pc.onicecandidate = function(event) {
-  if (event.candidate) {
-    // event.candidate가 존재하면 원격 유저에게 candidate를 전달합니다.
-  } else {
-    // 모든 ICE candidate가 원격 유저에게 전달된 조건에서 실행됩니다.
-    // candidate = null
-  }
-}
- -

위에서 알 수 있듯이, 이벤트의 {{domxref("RTCPeerConnectionIceEvent.candidate", "candidate")}} 속성이 null이면 네고시에이션의 종료가 감지됩니다. 

- -

명세

- - - - - - - - - - - - - - - - -
명세상태코멘트
{{ SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-onicecandidate', 'RTCPeerConnection.onicecandidate') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
- -

브라우저 호환성

- - - -

{{Compat("api.RTCPeerConnection.onicecandidate")}}

- -

참조

- - diff --git a/files/ko/web/api/rtcpeerconnection/onicegatheringstatechange/index.html b/files/ko/web/api/rtcpeerconnection/onicegatheringstatechange/index.html deleted file mode 100644 index 9831c5057c..0000000000 --- a/files/ko/web/api/rtcpeerconnection/onicegatheringstatechange/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: RTCPeerConnection.onicegatheringstatechange -slug: Web/API/RTCPeerConnection/onicegatheringstatechange -translation_of: Web/API/RTCPeerConnection/onicegatheringstatechange ---- -

{{APIRef("WebRTC")}}{{SeeCompatTable}}

- -

RTCPeerConnection.onicegatheringstatechange속성은 {{event("icegatheringstatechange")}} 이벤트가 {{domxref("RTCPeerConnection")}}에 전달될 때 호출이되는 함수를 정의하는 {{event("Event_handlers", "event handler")}}입니다. 이이벤트는 ICE 에이전트가 ICE candidate를 수집을 하는지의 여부를 알려주는 ICE 수집 상태가 변하면 발생합니다. 하지만, ICE 수집 상태를 모니터링 해야하는 특별한 이유가 없으면 이 이벤트를 감시 할 필요는 없습니다.

- -

Syntax

- -
RTCPeerConnection.onicegatheringstatechange = eventHandler;
-
- -

- -

{{event("icegatheringstatechange")}} 이벤트를 가진 {{domxref("Event")}} 객체를 단일 패러미터로 전달하는 함수를 제공합니다. {{domxref("RTCPeerConnection.iceGatheringState")}} 속성의 값 확인을 통해 ICE 수집 상태를 새로운 값으로 변경이 가능합니다.

- -

예시

- -

아래의 예제는 {{domxref("RTCPeerConnection.iceGatheringState", "iceGatheringState")}} 속성 값이 변할 때마다 현재 값을 확인하고, 수집 상태 변화에 맞추어 표시될 상태 내용을 업데이트해서 유저에게 알려줍니다.  

- -

이 상태는 {{HTMLElement("div")}} 요소에 텍스트로 표시됩니다.

- -
<div id="iceStatus"></div>
-
- -

예제에 사용된 이벤트 핸들러는 아래와 같습니다:

- -
pc.onicegatheringstatechange = function() {
-  let label = "Unknown";
-
-  switch(pc.iceGatheringState) {
-    case "new":
-    case "complete":
-      label = "Idle";
-      break;
-    case "gathering":
-      label = "Determining route";
-      break;
-  }
-  // HTML에서 id가 "iceStatus"인 요소에 label 값을 지정
-  document.getElementById("iceStatus").innerHTML = label;
-}
- -

명세

- - - - - - - - - - - - - - - - -
명세상태코멘트
{{ SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-onicegatheringstatechange', 'RTCPeerConnection.onicegatheringstatechange') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
- -

브라우저 호환성

- - - -

{{Compat("api.RTCPeerConnection.onicegatheringstatechange")}}

- -

참조

- - diff --git a/files/ko/web/api/rtcpeerconnection/ontrack/index.html b/files/ko/web/api/rtcpeerconnection/ontrack/index.html deleted file mode 100644 index d598a6194f..0000000000 --- a/files/ko/web/api/rtcpeerconnection/ontrack/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: RTCPeerConnection.ontrack -slug: Web/API/RTCPeerConnection/ontrack -translation_of: Web/API/RTCPeerConnection/ontrack ---- -
{{APIRef("WebRTC")}}
- -

{{domxref("RTCPeerConnection")}} 속성인 ontrack은 {{domxref("RTCPeerConnection")}}에 트랙이 등록됨을 알려주는 {{event("track")}}가 발생하면 호출되는 함수를 지정하는 {{event("Event_handlers", "event handler")}}입니다.

- -

이 함수는 {{domxref("RTCTrackEvent")}} 타입의 이벤트 객체를 입력 인자로 받습니다. 해당 이벤트는 신규로 받아지는 {{domxref("MediaStreamTrack")}}가 생성되고 연결의 리시버 세트에 추가된 {{domxref("RTCRtpReceiver")}}객체와 연관되면 전송됩니다.

- -

Syntax

- -
RTCPeerConnection.ontrack = eventHandler;
-
- -

- -

ontrack을 함수로 지정해서 신규 트랙에 대해 설명하고 어떻게 사용 될지를 알려주는 {{domxref("RTCTrackEvent")}} 객체를 입력 인자로 받도록 하십시오. 이 정보에는 신규 트랙을 나타내는 {{domxref("MediaStreamTrack")}} 객체, {{domxref("RTCRtpReceiver")}}와{{domxref("RTCRtpTransceiver")}}, 그리고 트랙이 어느 스트림에 해당하는지를 알려주는 {{domxref("MediaStream")}}의 리스트 객체를 포함합니다. 

- -

예시

- -

아래의 예시는 Signaling and video calling 문서에 나온 코드의 일부입니다. 이 코드는 들어오는 트랙을 {{HTMLElement("video")}}에 연결해서 해당 비디오를 보여줄 수 있도록 합니다.

- -
pc.ontrack = function(event) {
-  document.getElementById("received_video").srcObject = event.streams[0];
-  document.getElementById("hangup-button").disabled = false;
-};
-
-
- -

첫 줄에 나온 ontrack 이벤트 핸들러는 들어오는 트랙의 첫 스트림을 가져다가 {{htmlattrxref("srcObject", "video")}} 속성에 지정합니다. 이렇게 함으로써 비디오의 스트림을 해당 요소에 연결하고, 유저에게 보여 줄 수 있게됩니다. 두 번째줄에서는 "통화 종료" 버튼을 활성화하여 유저가 통화를 종료 할 수 있도록 해줍니다.

- -

사양서

- - - - - - - - - - - - - - - - -
사양서상태코멘트
{{SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-ontrack', 'RTCPeerConnection.ontrack')}}{{Spec2('WebRTC 1.0')}}Initial specification.
- -

브라우저 호환성

- - - -

{{Compat("api.RTCPeerConnection.ontrack")}}

- -

참조

- - diff --git a/files/ko/web/api/rtcpeerconnection/track_event/index.html b/files/ko/web/api/rtcpeerconnection/track_event/index.html new file mode 100644 index 0000000000..e3449ede3b --- /dev/null +++ b/files/ko/web/api/rtcpeerconnection/track_event/index.html @@ -0,0 +1,64 @@ +--- +title: RTCPeerConnection.ontrack +slug: Web/API/RTCPeerConnection/track_event +translation_of: Web/API/RTCPeerConnection/ontrack +original_slug: Web/API/RTCPeerConnection/ontrack +--- +
{{APIRef("WebRTC")}}
+ +

{{domxref("RTCPeerConnection")}} 속성인 ontrack은 {{domxref("RTCPeerConnection")}}에 트랙이 등록됨을 알려주는 {{event("track")}}가 발생하면 호출되는 함수를 지정하는 {{event("Event_handlers", "event handler")}}입니다.

+ +

이 함수는 {{domxref("RTCTrackEvent")}} 타입의 이벤트 객체를 입력 인자로 받습니다. 해당 이벤트는 신규로 받아지는 {{domxref("MediaStreamTrack")}}가 생성되고 연결의 리시버 세트에 추가된 {{domxref("RTCRtpReceiver")}}객체와 연관되면 전송됩니다.

+ +

Syntax

+ +
RTCPeerConnection.ontrack = eventHandler;
+
+ +

+ +

ontrack을 함수로 지정해서 신규 트랙에 대해 설명하고 어떻게 사용 될지를 알려주는 {{domxref("RTCTrackEvent")}} 객체를 입력 인자로 받도록 하십시오. 이 정보에는 신규 트랙을 나타내는 {{domxref("MediaStreamTrack")}} 객체, {{domxref("RTCRtpReceiver")}}와{{domxref("RTCRtpTransceiver")}}, 그리고 트랙이 어느 스트림에 해당하는지를 알려주는 {{domxref("MediaStream")}}의 리스트 객체를 포함합니다. 

+ +

예시

+ +

아래의 예시는 Signaling and video calling 문서에 나온 코드의 일부입니다. 이 코드는 들어오는 트랙을 {{HTMLElement("video")}}에 연결해서 해당 비디오를 보여줄 수 있도록 합니다.

+ +
pc.ontrack = function(event) {
+  document.getElementById("received_video").srcObject = event.streams[0];
+  document.getElementById("hangup-button").disabled = false;
+};
+
+
+ +

첫 줄에 나온 ontrack 이벤트 핸들러는 들어오는 트랙의 첫 스트림을 가져다가 {{htmlattrxref("srcObject", "video")}} 속성에 지정합니다. 이렇게 함으로써 비디오의 스트림을 해당 요소에 연결하고, 유저에게 보여 줄 수 있게됩니다. 두 번째줄에서는 "통화 종료" 버튼을 활성화하여 유저가 통화를 종료 할 수 있도록 해줍니다.

+ +

사양서

+ + + + + + + + + + + + + + + + +
사양서상태코멘트
{{SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-ontrack', 'RTCPeerConnection.ontrack')}}{{Spec2('WebRTC 1.0')}}Initial specification.
+ +

브라우저 호환성

+ + + +

{{Compat("api.RTCPeerConnection.ontrack")}}

+ +

참조

+ + diff --git a/files/ko/web/api/serviceworker/onstatechange/index.html b/files/ko/web/api/serviceworker/onstatechange/index.html deleted file mode 100644 index d6063f0445..0000000000 --- a/files/ko/web/api/serviceworker/onstatechange/index.html +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: ServiceWorker.onstatechange -slug: Web/API/ServiceWorker/onstatechange -translation_of: Web/API/ServiceWorker/onstatechange ---- -
{{SeeCompatTable}}{{APIRef("Service Workers API")}}
- -

statechange 타입의 이벤트가 발생될 때마다 호출되는 {{domxref("EventListener")}} 속성. 기본적으로 {{domxref("ServiceWorker.state")}}가 변경되는 시점에 발생한다.

- -

Syntax

- -
ServiceWorker.onstatechange = function(statechangeevent) { ... }
-ServiceWorker.addEventListener('statechange', function(statechangeevent) { ... } )
- -

Examples

- -

이 코드 조각은 service worker registration-events sample (live demo) 으로부터 가져온 것이다. 이 코드는 {{domxref("ServiceWorker.state")}}의 모든 변경 사항을 수신하고 그 값을 반환한다.

- -
var serviceWorker;
-if (registration.installing) {
-  serviceWorker = registration.installing;
-  document.querySelector('#kind').textContent = 'installing';
-} else if (registration.waiting) {
-  serviceWorker = registration.waiting;
-  document.querySelector('#kind').textContent = 'waiting';
-} else if (registration.active) {
-  serviceWorker = registration.active;
-  document.querySelector('#kind').textContent = 'active';
-}
-
-if (serviceWorker) {
-  logState(serviceWorker.state);
-  serviceWorker.addEventListener('statechange', function(e) {
-  logState(e.target.state);
-  });
-}
- -

statechange 가 발생할 때, 서비스워커의 참조들이 변화할 수 있으므로 주의하라. 예시:

- -
navigator.serviceWorker.register(..).then(function(swr) {
-  swr.installing.state == "installing"
-  swr.installing.onstatechange = function() {
-    swr.installing == null;
-    // 이 시점에서, swr.waiting 또는 swr.active는 true일 것이다. 이것은 statechange 이벤트가 대기 상태이기 때문이며,
-    // 그동안 잠재 상태의 워커가 waiting 상태가 될 수도 있으며 가능한 경우에는 즉시 activated 될 것이다.
-  }
-})
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Service Workers', '#service-worker-onstatechange-attribute', 'ServiceWorker.onstatechange')}}{{Spec2('Service Workers')}}Initial definition
- -

Browser compatibility

- -
- - -

{{Compat("api.ServiceWorker.onstatechange")}}

-
diff --git a/files/ko/web/api/serviceworker/statechange_event/index.html b/files/ko/web/api/serviceworker/statechange_event/index.html new file mode 100644 index 0000000000..aebeda7895 --- /dev/null +++ b/files/ko/web/api/serviceworker/statechange_event/index.html @@ -0,0 +1,73 @@ +--- +title: ServiceWorker.onstatechange +slug: Web/API/ServiceWorker/statechange_event +translation_of: Web/API/ServiceWorker/onstatechange +original_slug: Web/API/ServiceWorker/onstatechange +--- +
{{SeeCompatTable}}{{APIRef("Service Workers API")}}
+ +

statechange 타입의 이벤트가 발생될 때마다 호출되는 {{domxref("EventListener")}} 속성. 기본적으로 {{domxref("ServiceWorker.state")}}가 변경되는 시점에 발생한다.

+ +

Syntax

+ +
ServiceWorker.onstatechange = function(statechangeevent) { ... }
+ServiceWorker.addEventListener('statechange', function(statechangeevent) { ... } )
+ +

Examples

+ +

이 코드 조각은 service worker registration-events sample (live demo) 으로부터 가져온 것이다. 이 코드는 {{domxref("ServiceWorker.state")}}의 모든 변경 사항을 수신하고 그 값을 반환한다.

+ +
var serviceWorker;
+if (registration.installing) {
+  serviceWorker = registration.installing;
+  document.querySelector('#kind').textContent = 'installing';
+} else if (registration.waiting) {
+  serviceWorker = registration.waiting;
+  document.querySelector('#kind').textContent = 'waiting';
+} else if (registration.active) {
+  serviceWorker = registration.active;
+  document.querySelector('#kind').textContent = 'active';
+}
+
+if (serviceWorker) {
+  logState(serviceWorker.state);
+  serviceWorker.addEventListener('statechange', function(e) {
+  logState(e.target.state);
+  });
+}
+ +

statechange 가 발생할 때, 서비스워커의 참조들이 변화할 수 있으므로 주의하라. 예시:

+ +
navigator.serviceWorker.register(..).then(function(swr) {
+  swr.installing.state == "installing"
+  swr.installing.onstatechange = function() {
+    swr.installing == null;
+    // 이 시점에서, swr.waiting 또는 swr.active는 true일 것이다. 이것은 statechange 이벤트가 대기 상태이기 때문이며,
+    // 그동안 잠재 상태의 워커가 waiting 상태가 될 수도 있으며 가능한 경우에는 즉시 activated 될 것이다.
+  }
+})
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Service Workers', '#service-worker-onstatechange-attribute', 'ServiceWorker.onstatechange')}}{{Spec2('Service Workers')}}Initial definition
+ +

Browser compatibility

+ +
+ + +

{{Compat("api.ServiceWorker.onstatechange")}}

+
diff --git a/files/pt-br/_redirects.txt b/files/pt-br/_redirects.txt index f852975d04..e5c5f6508b 100644 --- a/files/pt-br/_redirects.txt +++ b/files/pt-br/_redirects.txt @@ -717,8 +717,10 @@ /pt-BR/docs/Web/HTTP/Gerenciamento_de_Conexão_em_HTTP_1.x /pt-BR/docs/Web/HTTP/Connection_management_in_HTTP_1.x /pt-BR/docs/Web/HTTP/HTTP /pt-BR/docs/Web/HTTP/Caching /pt-BR/docs/Web/HTTP/Headers/Conexão /pt-BR/docs/Web/HTTP/Headers/Connection +/pt-BR/docs/Web/HTTP/Headers/Cookie2 /pt-BR/docs/conflicting/Web/HTTP/Headers/Cookie /pt-BR/docs/Web/HTTP/Headers/Expira /pt-BR/docs/Web/HTTP/Headers/Expires /pt-BR/docs/Web/HTTP/Headers/Localização /pt-BR/docs/Web/HTTP/Headers/Location +/pt-BR/docs/Web/HTTP/Headers/Set-Cookie2 /pt-BR/docs/conflicting/Web/HTTP/Headers/Set-Cookie /pt-BR/docs/Web/HTTP/Mensagens /pt-BR/docs/Web/HTTP/Messages /pt-BR/docs/Web/HTTP/Redirecionamento /pt-BR/docs/Web/HTTP/Redirections /pt-BR/docs/Web/JavaScript/Enumerabilidade_e_posse_de_propriedades /pt-BR/docs/Web/JavaScript/Enumerability_and_ownership_of_properties diff --git a/files/pt-br/_wikihistory.json b/files/pt-br/_wikihistory.json index 26a483ad31..a16a54abbc 100644 --- a/files/pt-br/_wikihistory.json +++ b/files/pt-br/_wikihistory.json @@ -10539,12 +10539,6 @@ "FernandoKGA" ] }, - "Web/HTTP/Headers/Cookie2": { - "modified": "2020-10-15T22:29:27.166Z", - "contributors": [ - "FernandoKGA" - ] - }, "Web/HTTP/Headers/Cross-Origin-Resource-Policy": { "modified": "2020-10-15T22:29:30.347Z", "contributors": [ @@ -10805,12 +10799,6 @@ "ooVictorFranco" ] }, - "Web/HTTP/Headers/Set-Cookie2": { - "modified": "2020-10-15T22:31:37.734Z", - "contributors": [ - "FernandoKGA" - ] - }, "Web/HTTP/Headers/SourceMap": { "modified": "2020-10-15T22:20:50.501Z", "contributors": [ @@ -16507,6 +16495,18 @@ "marcio1002" ] }, + "conflicting/Web/HTTP/Headers/Cookie": { + "modified": "2020-10-15T22:29:27.166Z", + "contributors": [ + "FernandoKGA" + ] + }, + "conflicting/Web/HTTP/Headers/Set-Cookie": { + "modified": "2020-10-15T22:31:37.734Z", + "contributors": [ + "FernandoKGA" + ] + }, "conflicting/Web/JavaScript/Equality_comparisons_and_sameness": { "modified": "2019-03-23T23:25:15.038Z", "contributors": [ diff --git a/files/pt-br/conflicting/web/http/headers/cookie/index.html b/files/pt-br/conflicting/web/http/headers/cookie/index.html new file mode 100644 index 0000000000..6d33e9afac --- /dev/null +++ b/files/pt-br/conflicting/web/http/headers/cookie/index.html @@ -0,0 +1,59 @@ +--- +title: Cookie2 +slug: conflicting/Web/HTTP/Headers/Cookie +tags: + - Cabeçalho de requisição + - HTTP + - Obsoleto + - Referencia + - cabeçalho + - requisição +translation_of: Web/HTTP/Headers/Cookie2 +original_slug: Web/HTTP/Headers/Cookie2 +--- +
{{HTTPSidebar}} {{obsolete_header}}
+ +

O obsoleto cabeçalho de requisição HTTP Cookie2 costumava aconselhar o servidor que o agente de usuário entende cookies de "novo estilo", mas atualmente os agentes de usuário vão usar o cabeçalho {{HTTPHeader("Cookie")}} ao invés disso, não este.

+ + + + + + + + + + + + +
Tipo de cabeçalho{{Glossary("Request header")}}
{{Glossary("Forbidden header name")}}sim
+ +

Exemplos

+ +
Cookie2: $Version="1"
+ +

Especificações

+ + + + + + + + + + + + +
EspecificaçãoTítulo
{{RFC("2965", "Cookie2")}}Especificação histórica do HTTP State Management Mechanism, obsoleta pela {{RFC("6265")}}
+ +

Compatibilidade com navegadores

+ +

{{Compat("http.headers.Cookie2")}}

+ +

Veja também

+ + diff --git a/files/pt-br/conflicting/web/http/headers/set-cookie/index.html b/files/pt-br/conflicting/web/http/headers/set-cookie/index.html new file mode 100644 index 0000000000..4bde79adc9 --- /dev/null +++ b/files/pt-br/conflicting/web/http/headers/set-cookie/index.html @@ -0,0 +1,74 @@ +--- +title: Set-Cookie2 +slug: conflicting/Web/HTTP/Headers/Set-Cookie +tags: + - Cookies + - HTTP + - Obsoleto + - Referencia + - cabeçalho +translation_of: Web/HTTP/Headers/Set-Cookie2 +original_slug: Web/HTTP/Headers/Set-Cookie2 +--- +
{{HTTPSidebar}} {{obsolete_header}}
+ +

O obsoleto cabeçalho de resposta HTTP Set-Cookie2 usado para enviar cookies do servidor para o agente de usuário, mas ele foi depreciado por especificação. Use {{HTTPHeader("Set-Cookie")}} ao invés disso.

+ + + + + + + + + + + + +
Tipo de cabeçalho{{Glossary("Response header")}}
{{Glossary("Forbidden header name")}}não
+ +

Sintaxe

+ +
Set-Cookie2: <cookie-name>=<cookie-value>
+Set-Cookie2: <cookie-name>=<cookie-value>; Comment=<value>
+Set-Cookie2: <cookie-name>=<cookie-value>; CommentURL=<http-url>
+Set-Cookie2: <cookie-name>=<cookie-value>; Discard
+Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>
+Set-Cookie2: <cookie-name>=<cookie-value>; Max-Age=<non-zero-digit>
+Set-Cookie2: <cookie-name>=<cookie-value>; Path=<path-value>
+Set-Cookie2: <cookie-name>=<cookie-value>; Port=<port-number>
+Set-Cookie2: <cookie-name>=<cookie-value>; Secure
+Set-Cookie2: <cookie-name>=<cookie-value>; Version=<version-number>
+
+// Múltiplas diretivas também são possíveis, por exemplo:
+Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>; Secure
+
+// Múltiplos cookies são separados por vírgula
+Set-Cookie2: <cookie-name>=<cookie-value>, <cookie-name>=<cookie-value>, ...
+
+ +

Especificações

+ + + + + + + + + + + + +
EspecificaçãoTítulo
{{RFC("2965", "Set-Cookie2")}}Especificação histórica do Mecanismo de Gerenciamento de Estado do HTTP, obsoleto por {{RFC("6265")}} (Historic specification of HTTP State Management Mechanism, obsoleted by {{RFC("6265")}})
+ +

Compatibilidade com navegadores

+ +

{{Compat("http.headers.Set-Cookie2")}}

+ +

Veja também

+ + diff --git a/files/pt-br/web/http/headers/cookie2/index.html b/files/pt-br/web/http/headers/cookie2/index.html deleted file mode 100644 index 9ef4fb6e17..0000000000 --- a/files/pt-br/web/http/headers/cookie2/index.html +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: Cookie2 -slug: Web/HTTP/Headers/Cookie2 -tags: - - Cabeçalho de requisição - - HTTP - - Obsoleto - - Referencia - - cabeçalho - - requisição -translation_of: Web/HTTP/Headers/Cookie2 ---- -
{{HTTPSidebar}} {{obsolete_header}}
- -

O obsoleto cabeçalho de requisição HTTP Cookie2 costumava aconselhar o servidor que o agente de usuário entende cookies de "novo estilo", mas atualmente os agentes de usuário vão usar o cabeçalho {{HTTPHeader("Cookie")}} ao invés disso, não este.

- - - - - - - - - - - - -
Tipo de cabeçalho{{Glossary("Request header")}}
{{Glossary("Forbidden header name")}}sim
- -

Exemplos

- -
Cookie2: $Version="1"
- -

Especificações

- - - - - - - - - - - - -
EspecificaçãoTítulo
{{RFC("2965", "Cookie2")}}Especificação histórica do HTTP State Management Mechanism, obsoleta pela {{RFC("6265")}}
- -

Compatibilidade com navegadores

- -

{{Compat("http.headers.Cookie2")}}

- -

Veja também

- - diff --git a/files/pt-br/web/http/headers/set-cookie2/index.html b/files/pt-br/web/http/headers/set-cookie2/index.html deleted file mode 100644 index b0dafc333c..0000000000 --- a/files/pt-br/web/http/headers/set-cookie2/index.html +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: Set-Cookie2 -slug: Web/HTTP/Headers/Set-Cookie2 -tags: - - Cookies - - HTTP - - Obsoleto - - Referencia - - cabeçalho -translation_of: Web/HTTP/Headers/Set-Cookie2 ---- -
{{HTTPSidebar}} {{obsolete_header}}
- -

O obsoleto cabeçalho de resposta HTTP Set-Cookie2 usado para enviar cookies do servidor para o agente de usuário, mas ele foi depreciado por especificação. Use {{HTTPHeader("Set-Cookie")}} ao invés disso.

- - - - - - - - - - - - -
Tipo de cabeçalho{{Glossary("Response header")}}
{{Glossary("Forbidden header name")}}não
- -

Sintaxe

- -
Set-Cookie2: <cookie-name>=<cookie-value>
-Set-Cookie2: <cookie-name>=<cookie-value>; Comment=<value>
-Set-Cookie2: <cookie-name>=<cookie-value>; CommentURL=<http-url>
-Set-Cookie2: <cookie-name>=<cookie-value>; Discard
-Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>
-Set-Cookie2: <cookie-name>=<cookie-value>; Max-Age=<non-zero-digit>
-Set-Cookie2: <cookie-name>=<cookie-value>; Path=<path-value>
-Set-Cookie2: <cookie-name>=<cookie-value>; Port=<port-number>
-Set-Cookie2: <cookie-name>=<cookie-value>; Secure
-Set-Cookie2: <cookie-name>=<cookie-value>; Version=<version-number>
-
-// Múltiplas diretivas também são possíveis, por exemplo:
-Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>; Secure
-
-// Múltiplos cookies são separados por vírgula
-Set-Cookie2: <cookie-name>=<cookie-value>, <cookie-name>=<cookie-value>, ...
-
- -

Especificações

- - - - - - - - - - - - -
EspecificaçãoTítulo
{{RFC("2965", "Set-Cookie2")}}Especificação histórica do Mecanismo de Gerenciamento de Estado do HTTP, obsoleto por {{RFC("6265")}} (Historic specification of HTTP State Management Mechanism, obsoleted by {{RFC("6265")}})
- -

Compatibilidade com navegadores

- -

{{Compat("http.headers.Set-Cookie2")}}

- -

Veja também

- - diff --git a/files/ru/_redirects.txt b/files/ru/_redirects.txt index c9aa710795..1c06359a39 100644 --- a/files/ru/_redirects.txt +++ b/files/ru/_redirects.txt @@ -373,6 +373,7 @@ /ru/docs/Web/API/PositionError /ru/docs/Web/API/GeolocationPositionError /ru/docs/Web/API/PositionOptions /ru/docs/conflicting/Web/API/Geolocation/getCurrentPosition /ru/docs/Web/API/RandomSource/getRandomValues /ru/docs/Web/API/Crypto/getRandomValues +/ru/docs/Web/API/ServiceWorker/onstatechange /ru/docs/Web/API/ServiceWorker/statechange_event /ru/docs/Web/API/Touch_events/Supporting_both_TouchEvent_and_MouseEvent /ru/docs/conflicting/Web/API/Pointer_events /ru/docs/Web/API/USB/onconnect /ru/docs/Web/API/USB/connect_event /ru/docs/Web/API/USB/ondisconnect /ru/docs/Web/API/USB/disconnect_event diff --git a/files/ru/_wikihistory.json b/files/ru/_wikihistory.json index 17f599b98d..1bae2b40bf 100644 --- a/files/ru/_wikihistory.json +++ b/files/ru/_wikihistory.json @@ -10111,12 +10111,6 @@ "sh7dm" ] }, - "Web/API/ServiceWorker/onstatechange": { - "modified": "2020-10-15T22:25:53.618Z", - "contributors": [ - "sh7dm" - ] - }, "Web/API/ServiceWorker/scriptURL": { "modified": "2020-10-15T22:25:53.547Z", "contributors": [ @@ -10129,6 +10123,12 @@ "sh7dm" ] }, + "Web/API/ServiceWorker/statechange_event": { + "modified": "2020-10-15T22:25:53.618Z", + "contributors": [ + "sh7dm" + ] + }, "Web/API/ServiceWorkerContainer": { "modified": "2020-04-09T10:43:47.005Z", "contributors": [ diff --git a/files/ru/web/api/serviceworker/onstatechange/index.html b/files/ru/web/api/serviceworker/onstatechange/index.html deleted file mode 100644 index d7b171e887..0000000000 --- a/files/ru/web/api/serviceworker/onstatechange/index.html +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: ServiceWorker.onstatechange -slug: Web/API/ServiceWorker/onstatechange -translation_of: Web/API/ServiceWorker/onstatechange ---- -
{{APIRef("Service Workers API")}}
- -

Обработчик события, вызываемый при срабатывании события statechange; по сути, срабатывает при изменении {{domxref("ServiceWorker.state")}}.

- -

Синтаксис

- -
ServiceWorker.onstatechange = function(statechangeevent) { ... }
-ServiceWorker.addEventListener('statechange', function(statechangeevent) { ... } )
- -

Примеры

- -

Данный фрагмент кода из примера событий service worker (демо) возвращает состояние при каждом его изменении.

- -
var serviceWorker;
-if (registration.installing) {
-  serviceWorker = registration.installing;
-  document.querySelector('#kind').textContent = 'installing';
-} else if (registration.waiting) {
-  serviceWorker = registration.waiting;
-  document.querySelector('#kind').textContent = 'waiting';
-} else if (registration.active) {
-  serviceWorker = registration.active;
-  document.querySelector('#kind').textContent = 'active';
-}
-
-if (serviceWorker) {
-  logState(serviceWorker.state);
-  serviceWorker.addEventListener('statechange', function(e) {
-  logState(e.target.state);
-  });
-}
- -

Обратите внимание, что при срабатывании statechange, ссылки на service worker могли измениться. Например:

- -
navigator.serviceWorker.register(..).then(function(swr) {
-  swr.installing.state == "installing"
-  swr.installing.onstatechange = function() {
-    swr.installing == null;
-    // At this point, swr.waiting OR swr.active might be true. This is because the statechange
-    // event gets queued, meanwhile the underlying worker may have gone into the waiting
-    // state and will be immediately activated if possible.
-  }
-})
- -

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

- -{{Specifications}} - -

Совместимость

- -
- - -

{{Compat}}

-
diff --git a/files/ru/web/api/serviceworker/statechange_event/index.html b/files/ru/web/api/serviceworker/statechange_event/index.html new file mode 100644 index 0000000000..b03607e229 --- /dev/null +++ b/files/ru/web/api/serviceworker/statechange_event/index.html @@ -0,0 +1,61 @@ +--- +title: ServiceWorker.onstatechange +slug: Web/API/ServiceWorker/statechange_event +translation_of: Web/API/ServiceWorker/onstatechange +original_slug: Web/API/ServiceWorker/onstatechange +--- +
{{APIRef("Service Workers API")}}
+ +

Обработчик события, вызываемый при срабатывании события statechange; по сути, срабатывает при изменении {{domxref("ServiceWorker.state")}}.

+ +

Синтаксис

+ +
ServiceWorker.onstatechange = function(statechangeevent) { ... }
+ServiceWorker.addEventListener('statechange', function(statechangeevent) { ... } )
+ +

Примеры

+ +

Данный фрагмент кода из примера событий service worker (демо) возвращает состояние при каждом его изменении.

+ +
var serviceWorker;
+if (registration.installing) {
+  serviceWorker = registration.installing;
+  document.querySelector('#kind').textContent = 'installing';
+} else if (registration.waiting) {
+  serviceWorker = registration.waiting;
+  document.querySelector('#kind').textContent = 'waiting';
+} else if (registration.active) {
+  serviceWorker = registration.active;
+  document.querySelector('#kind').textContent = 'active';
+}
+
+if (serviceWorker) {
+  logState(serviceWorker.state);
+  serviceWorker.addEventListener('statechange', function(e) {
+  logState(e.target.state);
+  });
+}
+ +

Обратите внимание, что при срабатывании statechange, ссылки на service worker могли измениться. Например:

+ +
navigator.serviceWorker.register(..).then(function(swr) {
+  swr.installing.state == "installing"
+  swr.installing.onstatechange = function() {
+    swr.installing == null;
+    // At this point, swr.waiting OR swr.active might be true. This is because the statechange
+    // event gets queued, meanwhile the underlying worker may have gone into the waiting
+    // state and will be immediately activated if possible.
+  }
+})
+ +

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

+ +{{Specifications}} + +

Совместимость

+ +
+ + +

{{Compat}}

+
diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index 3b9ee0afb5..aa184cbb38 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -1483,6 +1483,10 @@ /zh-CN/docs/Web/API/PositionOptions /zh-CN/docs/conflicting/Web/API/Geolocation/getCurrentPosition /zh-CN/docs/Web/API/PositionOptions/timeout /zh-CN/docs/conflicting/Web/API/Geolocation/getCurrentPosition_058087067b28ad25fff974fd59827fb6 /zh-CN/docs/Web/API/RTCConfiguration /zh-CN/docs/conflicting/Web/API/RTCPeerConnection/RTCPeerConnection +/zh-CN/docs/Web/API/RTCPeerConnection/onaddstream /zh-CN/docs/Web/API/RTCPeerConnection/addstream_event +/zh-CN/docs/Web/API/RTCPeerConnection/ondatachannel /zh-CN/docs/Web/API/RTCPeerConnection/datachannel_event +/zh-CN/docs/Web/API/RTCPeerConnection/onicecandidate /zh-CN/docs/conflicting/Web/API/RTCPeerConnection/icecandidate_event +/zh-CN/docs/Web/API/RTCPeerConnection/ontrack /zh-CN/docs/Web/API/RTCPeerConnection/track_event /zh-CN/docs/Web/API/RandomSource/getRandomValues /zh-CN/docs/Web/API/Crypto/getRandomValues /zh-CN/docs/Web/API/Response/克隆 /zh-CN/docs/Web/API/Response/clone /zh-CN/docs/Web/API/SVGPathElement/getTotalLength /zh-CN/docs/Web/API/SVGGeometryElement/getTotalLength @@ -1503,6 +1507,7 @@ /zh-CN/docs/Web/API/Selection.isCollapsed /zh-CN/docs/Web/API/Selection/isCollapsed /zh-CN/docs/Web/API/Selection.removeRange /zh-CN/docs/Web/API/Selection/removeRange /zh-CN/docs/Web/API/Selection/从Document中删除 /zh-CN/docs/Web/API/Selection/deleteFromDocument +/zh-CN/docs/Web/API/ServiceWorker/onstatechange /zh-CN/docs/Web/API/ServiceWorker/statechange_event /zh-CN/docs/Web/API/ServiceWorkerGlobalScope/caches /zh-CN/docs/conflicting/Web/API/caches /zh-CN/docs/Web/API/StorageEstimate /zh-CN/docs/conflicting/Web/API/StorageManager/estimate /zh-CN/docs/Web/API/Streams_API/使用可读文件流 /zh-CN/docs/Web/API/Streams_API/Using_readable_streams @@ -2048,6 +2053,8 @@ /zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy__by_cnvoid/require-sri-for /zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy/require-sri-for /zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy__by_cnvoid/sandbox /zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy/sandbox /zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy__by_cnvoid/upgrade-insecure-requests /zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy/upgrade-insecure-requests +/zh-CN/docs/Web/HTTP/Headers/Cookie2 /zh-CN/docs/conflicting/Web/HTTP/Headers/Cookie +/zh-CN/docs/Web/HTTP/Headers/Set-Cookie2 /zh-CN/docs/conflicting/Web/HTTP/Headers/Set-Cookie /zh-CN/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_(PAC)_file /zh-CN/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file /zh-CN/docs/Web/HTTP/Response_codes /zh-CN/docs/Web/HTTP/Status /zh-CN/docs/Web/HTTP/Response_codes/100 /zh-CN/docs/Web/HTTP/Status/100 diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index 4dcfa7ff44..a748dafa8d 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -18720,6 +18720,12 @@ "Mr.Chenzm" ] }, + "Web/API/RTCPeerConnection/addstream_event": { + "modified": "2019-03-23T22:57:28.674Z", + "contributors": [ + "starsun" + ] + }, "Web/API/RTCPeerConnection/canTrickleIceCandidates": { "modified": "2020-10-15T22:17:37.803Z", "contributors": [ @@ -18752,6 +18758,12 @@ "SDUTWSL" ] }, + "Web/API/RTCPeerConnection/datachannel_event": { + "modified": "2019-03-23T22:21:43.126Z", + "contributors": [ + "physihan" + ] + }, "Web/API/RTCPeerConnection/getReceivers": { "modified": "2020-10-15T22:34:32.923Z", "contributors": [ @@ -18778,30 +18790,6 @@ "BillgoXu" ] }, - "Web/API/RTCPeerConnection/onaddstream": { - "modified": "2019-03-23T22:57:28.674Z", - "contributors": [ - "starsun" - ] - }, - "Web/API/RTCPeerConnection/ondatachannel": { - "modified": "2019-03-23T22:21:43.126Z", - "contributors": [ - "physihan" - ] - }, - "Web/API/RTCPeerConnection/onicecandidate": { - "modified": "2020-10-15T22:21:52.694Z", - "contributors": [ - "babaiwan" - ] - }, - "Web/API/RTCPeerConnection/ontrack": { - "modified": "2019-03-18T21:45:45.168Z", - "contributors": [ - "track_vovo" - ] - }, "Web/API/RTCPeerConnection/peerIdentity": { "modified": "2020-10-15T22:23:54.416Z", "contributors": [ @@ -18833,6 +18821,12 @@ "w05163" ] }, + "Web/API/RTCPeerConnection/track_event": { + "modified": "2019-03-18T21:45:45.168Z", + "contributors": [ + "track_vovo" + ] + }, "Web/API/RTCRtpTransceiver": { "modified": "2020-10-15T22:34:39.974Z", "contributors": [ @@ -19732,12 +19726,6 @@ "marsoln" ] }, - "Web/API/ServiceWorker/onstatechange": { - "modified": "2019-03-23T22:08:26.258Z", - "contributors": [ - "fanyer" - ] - }, "Web/API/ServiceWorker/scriptURL": { "modified": "2019-03-23T22:08:31.728Z", "contributors": [ @@ -19750,6 +19738,12 @@ "fanyer" ] }, + "Web/API/ServiceWorker/statechange_event": { + "modified": "2019-03-23T22:08:26.258Z", + "contributors": [ + "fanyer" + ] + }, "Web/API/ServiceWorkerContainer": { "modified": "2019-03-23T22:22:40.555Z", "contributors": [ @@ -33666,12 +33660,6 @@ "WayneCui" ] }, - "Web/HTTP/Headers/Cookie2": { - "modified": "2020-10-15T21:54:52.521Z", - "contributors": [ - "WayneCui" - ] - }, "Web/HTTP/Headers/Cross-Origin-Embedder-Policy": { "modified": "2020-10-15T22:33:37.678Z", "contributors": [ @@ -34006,12 +33994,6 @@ "tinaawang" ] }, - "Web/HTTP/Headers/Set-Cookie2": { - "modified": "2020-10-15T21:54:57.437Z", - "contributors": [ - "WayneCui" - ] - }, "Web/HTTP/Headers/SourceMap": { "modified": "2020-10-15T21:55:30.390Z", "contributors": [ @@ -47167,6 +47149,12 @@ "moshoujingli" ] }, + "conflicting/Web/API/RTCPeerConnection/icecandidate_event": { + "modified": "2020-10-15T22:21:52.694Z", + "contributors": [ + "babaiwan" + ] + }, "conflicting/Web/API/StorageManager/estimate": { "modified": "2019-03-18T21:31:04.064Z", "contributors": [ @@ -47610,6 +47598,18 @@ "ziyunfei" ] }, + "conflicting/Web/HTTP/Headers/Cookie": { + "modified": "2020-10-15T21:54:52.521Z", + "contributors": [ + "WayneCui" + ] + }, + "conflicting/Web/HTTP/Headers/Set-Cookie": { + "modified": "2020-10-15T21:54:57.437Z", + "contributors": [ + "WayneCui" + ] + }, "conflicting/Web/HTTP/Status": { "modified": "2019-01-16T13:20:30.376Z", "contributors": [ diff --git a/files/zh-cn/conflicting/web/api/rtcpeerconnection/icecandidate_event/index.html b/files/zh-cn/conflicting/web/api/rtcpeerconnection/icecandidate_event/index.html new file mode 100644 index 0000000000..8759f7aada --- /dev/null +++ b/files/zh-cn/conflicting/web/api/rtcpeerconnection/icecandidate_event/index.html @@ -0,0 +1,66 @@ +--- +title: RTCPeerConnection.onicecandidate +slug: conflicting/Web/API/RTCPeerConnection/icecandidate_event +translation_of: Web/API/RTCPeerConnection/onicecandidate +original_slug: Web/API/RTCPeerConnection/onicecandidate +--- +

{{APIRef("WebRTC")}}

+ +

 RTCPeerConnection 的属性 {{domxref("RTCPeerConnection.onicecandidate", "onicecandidate")}} (是一个事件触发器 {{event("Event_handlers", "event handler")}}) 能够让函数在事件{{event("icecandidate")}}发生在实例  {{domxref("RTCPeerConnection")}} 上时被调用。 只要本地代理{{Glossary("ICE")}} 需要通过信令服务器传递信息给其他对等端时就会触发 这让本地代理与其他对等体相协商而浏览器本身在使用时无需知道任何详细的有关信令技术的细节,只需要简单地应用这种方法就可使用您选择的任何消息传递技术将ICE候选发送到远程对等方。

+ +

Syntax

+ +
rtcPeerConnection.onicecandidate = eventHandler;
+
+ +

Value

+ +

这应该设置为您提供的函数,该函数接受RTCPeerConnectionIceEvent表示icecandidate事件对象作为输入该功能应该通过信令服务器将可以在事件属性中找到SDP的ICE候选者传递candidate给远程对等体。

+ +

如果事件的candidate属性是null,ICE收集已经完成。不应将此消息发送到远程对等方。发生这种情况时,连接iceGatheringState也已更改为complete你不需要明确地注意这一点; 相反,如果你需要感知信令的结束,你应该注意一个icegatheringstatechange事件,表明ICE协商已经转变为complete状态。

+ +

Example

+ +

下面的示例基于文章信令和视频调用中的代码,icecandidate事件设置处理程序,以便将候选项发送到远程对等方。

+ +
pc.onicecandidate = function(event) {
+  if (event.candidate) {
+    // Send the candidate to the remote peer
+  } else {
+    // All ICE candidates have been sent
+  }
+}
+ +

请注意,当检测到协议结束时{{domxref("RTCPeerConnectionIceEvent.candidate", "candidate")}} 属性为 null.

+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
WebRTC 1.0:浏览器之间的实时通信
+ 该规范中“RTCPeerConnection.onicecandidate”的定义。
{{ Spec2('WebRTC 1.0') }}Initial specification.
+ +

浏览器兼容性

+ + + +

{{Compat("api.RTCPeerConnection.onicecandidate")}}

+ +

See also

+ + diff --git a/files/zh-cn/conflicting/web/http/headers/cookie/index.html b/files/zh-cn/conflicting/web/http/headers/cookie/index.html new file mode 100644 index 0000000000..3b17451de1 --- /dev/null +++ b/files/zh-cn/conflicting/web/http/headers/cookie/index.html @@ -0,0 +1,56 @@ +--- +title: Cookie2 +slug: conflicting/Web/HTTP/Headers/Cookie +tags: + - 废弃 + - 请求首部 + - 首部 +translation_of: Web/HTTP/Headers/Cookie2 +original_slug: Web/HTTP/Headers/Cookie2 +--- +
{{HTTPSidebar}} {{obsolete_header}}
+ +

这个已经被废弃的 Cookie2 请求首部曾经被用来告知浏览器该用户代理支持“新型” cookies,但是现代的用户代理一般使用 {{HTTPHeader("Cookie")}} 来替代 Cookie2

+ + + + + + + + + + + + +
Header type{{Glossary("Request header")}}
{{Glossary("Forbidden header name")}}yes
+ +

示例

+ +
Cookie2: $Version="1"
+ +

规范

+ + + + + + + + + + + + +
SpecificationTitle
{{RFC("2965", "Cookie2")}}Historic specification of HTTP State Management Mechanism, obsoleted by {{RFC("6265")}}
+ +

浏览器兼容性

+ +

{{Compat("http.headers.Cookie2")}}

+ +

相关内容

+ + diff --git a/files/zh-cn/conflicting/web/http/headers/set-cookie/index.html b/files/zh-cn/conflicting/web/http/headers/set-cookie/index.html new file mode 100644 index 0000000000..eab79f915f --- /dev/null +++ b/files/zh-cn/conflicting/web/http/headers/set-cookie/index.html @@ -0,0 +1,71 @@ +--- +title: Set-Cookie2 +slug: conflicting/Web/HTTP/Headers/Set-Cookie +tags: + - 废止 + - 首部 +translation_of: Web/HTTP/Headers/Set-Cookie2 +original_slug: Web/HTTP/Headers/Set-Cookie2 +--- +
{{HTTPSidebar}} {{obsolete_header}}
+ +

Set-Cookie2 是一个响应首部,已废弃使用。它被服务器用来向客户端发送 cookie 数据,但是已经在协议中被标记为不赞成使用了。请使用 {{HTTPHeader("Set-Cookie")}}  将其代替。

+ + + + + + + + + + + + +
Header type{{Glossary("Response header")}}
{{Glossary("Forbidden header name")}}no
+ +

语法

+ +
Set-Cookie2: <cookie-name>=<cookie-value>
+Set-Cookie2: <cookie-name>=<cookie-value>; Comment=<value>
+Set-Cookie2: <cookie-name>=<cookie-value>; CommentURL=<http-url>
+Set-Cookie2: <cookie-name>=<cookie-value>; Discard
+Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>
+Set-Cookie2: <cookie-name>=<cookie-value>; Max-Age=<non-zero-digit>
+Set-Cookie2: <cookie-name>=<cookie-value>; Path=<path-value>
+Set-Cookie2: <cookie-name>=<cookie-value>; Port=<port-number>
+Set-Cookie2: <cookie-name>=<cookie-value>; Secure
+Set-Cookie2: <cookie-name>=<cookie-value>; Version=<version-number>
+
+// Multiple directives are also possible, for example:
+Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>; Secure
+
+// Multiple cookies are seperated by a comma
+Set-Cookie2: <cookie-name>=<cookie-value>, <cookie-name>=<cookie-value>, ...
+
+ +

规范

+ + + + + + + + + + + + +
SpecificationTitle
{{RFC("2965", "Set-Cookie2")}}Historic specification of HTTP State Management Mechanism, obsoleted by {{RFC("6265")}}
+ +

浏览器兼容性

+ +

{{Compat("http.headers.Set-Cookie2")}}

+ +

相关内容

+ + diff --git a/files/zh-cn/web/api/rtcpeerconnection/addstream_event/index.html b/files/zh-cn/web/api/rtcpeerconnection/addstream_event/index.html new file mode 100644 index 0000000000..25483657c8 --- /dev/null +++ b/files/zh-cn/web/api/rtcpeerconnection/addstream_event/index.html @@ -0,0 +1,54 @@ +--- +title: RTCPeerConnection.onaddstream +slug: Web/API/RTCPeerConnection/addstream_event +translation_of: Web/API/RTCPeerConnection/onaddstream +original_slug: Web/API/RTCPeerConnection/onaddstream +--- +

{{APIRef("WebRTC")}}{{SeeCompatTable}}

+ +

当类型为{{domxref("MediaStreamEvent")}}的{{event("addstream")}} 事件发生时,通过{{domxref("RTCPeerConnection")}}触发RTCPeerConnection.onaddstream 事件处理函数。当远程媒体流{{domxref("MediaStream")}} 添加到连接后发送事件。当{{domxref("RTCPeerConnection.setRemoteDescription()")}} 后此事件立即被调用而不需要等待SDP交换完成。

+ +

语法

+ +
peerconnection.onaddstream = function;
+
+ +

+ + + +

例子

+ +
pc.onaddstream = function(ev) { alert("onaddstream event detected!"); };
+
+ +

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{ SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-onaddstream', 'RTCPeerConnection.onaddstream') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
+ +

浏览器兼容性

+ +{{Compat("api.RTCPeerConnection.onaddstream")}} + +

扩展阅读

+ + diff --git a/files/zh-cn/web/api/rtcpeerconnection/datachannel_event/index.html b/files/zh-cn/web/api/rtcpeerconnection/datachannel_event/index.html new file mode 100644 index 0000000000..921f9a0449 --- /dev/null +++ b/files/zh-cn/web/api/rtcpeerconnection/datachannel_event/index.html @@ -0,0 +1,61 @@ +--- +title: RTCPeerConnection.ondatachannel +slug: Web/API/RTCPeerConnection/datachannel_event +translation_of: Web/API/RTCPeerConnection/ondatachannel +original_slug: Web/API/RTCPeerConnection/ondatachannel +--- +

{{APIRef("WebRTC")}}{{SeeCompatTable}}

+ +

RTCPeerConnection.ondatachannel 属性是一个{{event("Event_handlers", "event handler")}},当这个{{event("datachannel")}}事件在{{domxref("RTCPeerConnection")}}发生时,它指定的那个事件处理函数就会被调用。这个事件继承于 {{domxref("RTCDataChannelEvent")}},当远方伙伴调用{{domxref("RTCPeerConnection.createDataChannel", "createDataChannel()")}}时这个事件被加到这个连接(RTCPeerConnection)中。

+ +

在这个事件被收到的同时,这个{{domxref("RTCDataChannel")}} 实际上并没有打开,确保在open这个事件在RTCDataChannel触发以后才去使用它。

+ +

语法

+ +
RTCPeerConnection.ondatachannel = function;
+
+ +

+ +

将这个属性设置为接受一个参数的函数:这个参数是一个{{domxref("RTCDataChannelEvent")}},它的channel属性是一个已经创建了的{{domxref("RTCDataChannel")}}对象

+ +

示例

+ +
pc.ondatachannel = function(ev) {
+  console.log('Data channel is created!');
+  ev.channel.onopen = function() {
+    console.log('Data channel is open and ready to be used.');
+  };
+};
+
+ +

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{ SpecName('WebRTC 1.0', '#dom-rtcpeerconnection-ondatachannel', 'RTCPeerConnection.ondatachannel') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
+ +

浏览器支持

+ +{{Compat("api.RTCPeerConnection.ondatachannel")}} + +

相关阅读

+ + diff --git a/files/zh-cn/web/api/rtcpeerconnection/onaddstream/index.html b/files/zh-cn/web/api/rtcpeerconnection/onaddstream/index.html deleted file mode 100644 index a61e2f28c6..0000000000 --- a/files/zh-cn/web/api/rtcpeerconnection/onaddstream/index.html +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: RTCPeerConnection.onaddstream -slug: Web/API/RTCPeerConnection/onaddstream -translation_of: Web/API/RTCPeerConnection/onaddstream ---- -

{{APIRef("WebRTC")}}{{SeeCompatTable}}

- -

当类型为{{domxref("MediaStreamEvent")}}的{{event("addstream")}} 事件发生时,通过{{domxref("RTCPeerConnection")}}触发RTCPeerConnection.onaddstream 事件处理函数。当远程媒体流{{domxref("MediaStream")}} 添加到连接后发送事件。当{{domxref("RTCPeerConnection.setRemoteDescription()")}} 后此事件立即被调用而不需要等待SDP交换完成。

- -

语法

- -
peerconnection.onaddstream = function;
-
- -

- - - -

例子

- -
pc.onaddstream = function(ev) { alert("onaddstream event detected!"); };
-
- -

规范

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{ SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-onaddstream', 'RTCPeerConnection.onaddstream') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
- -

浏览器兼容性

- -{{Compat("api.RTCPeerConnection.onaddstream")}} - -

扩展阅读

- - diff --git a/files/zh-cn/web/api/rtcpeerconnection/ondatachannel/index.html b/files/zh-cn/web/api/rtcpeerconnection/ondatachannel/index.html deleted file mode 100644 index 73b9b136ed..0000000000 --- a/files/zh-cn/web/api/rtcpeerconnection/ondatachannel/index.html +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: RTCPeerConnection.ondatachannel -slug: Web/API/RTCPeerConnection/ondatachannel -translation_of: Web/API/RTCPeerConnection/ondatachannel ---- -

{{APIRef("WebRTC")}}{{SeeCompatTable}}

- -

RTCPeerConnection.ondatachannel 属性是一个{{event("Event_handlers", "event handler")}},当这个{{event("datachannel")}}事件在{{domxref("RTCPeerConnection")}}发生时,它指定的那个事件处理函数就会被调用。这个事件继承于 {{domxref("RTCDataChannelEvent")}},当远方伙伴调用{{domxref("RTCPeerConnection.createDataChannel", "createDataChannel()")}}时这个事件被加到这个连接(RTCPeerConnection)中。

- -

在这个事件被收到的同时,这个{{domxref("RTCDataChannel")}} 实际上并没有打开,确保在open这个事件在RTCDataChannel触发以后才去使用它。

- -

语法

- -
RTCPeerConnection.ondatachannel = function;
-
- -

- -

将这个属性设置为接受一个参数的函数:这个参数是一个{{domxref("RTCDataChannelEvent")}},它的channel属性是一个已经创建了的{{domxref("RTCDataChannel")}}对象

- -

示例

- -
pc.ondatachannel = function(ev) {
-  console.log('Data channel is created!');
-  ev.channel.onopen = function() {
-    console.log('Data channel is open and ready to be used.');
-  };
-};
-
- -

规范

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{ SpecName('WebRTC 1.0', '#dom-rtcpeerconnection-ondatachannel', 'RTCPeerConnection.ondatachannel') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
- -

浏览器支持

- -{{Compat("api.RTCPeerConnection.ondatachannel")}} - -

相关阅读

- - diff --git a/files/zh-cn/web/api/rtcpeerconnection/onicecandidate/index.html b/files/zh-cn/web/api/rtcpeerconnection/onicecandidate/index.html deleted file mode 100644 index a0efcfed3a..0000000000 --- a/files/zh-cn/web/api/rtcpeerconnection/onicecandidate/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: RTCPeerConnection.onicecandidate -slug: Web/API/RTCPeerConnection/onicecandidate -translation_of: Web/API/RTCPeerConnection/onicecandidate ---- -

{{APIRef("WebRTC")}}

- -

 RTCPeerConnection 的属性 {{domxref("RTCPeerConnection.onicecandidate", "onicecandidate")}} (是一个事件触发器 {{event("Event_handlers", "event handler")}}) 能够让函数在事件{{event("icecandidate")}}发生在实例  {{domxref("RTCPeerConnection")}} 上时被调用。 只要本地代理{{Glossary("ICE")}} 需要通过信令服务器传递信息给其他对等端时就会触发 这让本地代理与其他对等体相协商而浏览器本身在使用时无需知道任何详细的有关信令技术的细节,只需要简单地应用这种方法就可使用您选择的任何消息传递技术将ICE候选发送到远程对等方。

- -

Syntax

- -
rtcPeerConnection.onicecandidate = eventHandler;
-
- -

Value

- -

这应该设置为您提供的函数,该函数接受RTCPeerConnectionIceEvent表示icecandidate事件对象作为输入该功能应该通过信令服务器将可以在事件属性中找到SDP的ICE候选者传递candidate给远程对等体。

- -

如果事件的candidate属性是null,ICE收集已经完成。不应将此消息发送到远程对等方。发生这种情况时,连接iceGatheringState也已更改为complete你不需要明确地注意这一点; 相反,如果你需要感知信令的结束,你应该注意一个icegatheringstatechange事件,表明ICE协商已经转变为complete状态。

- -

Example

- -

下面的示例基于文章信令和视频调用中的代码,icecandidate事件设置处理程序,以便将候选项发送到远程对等方。

- -
pc.onicecandidate = function(event) {
-  if (event.candidate) {
-    // Send the candidate to the remote peer
-  } else {
-    // All ICE candidates have been sent
-  }
-}
- -

请注意,当检测到协议结束时{{domxref("RTCPeerConnectionIceEvent.candidate", "candidate")}} 属性为 null.

- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
WebRTC 1.0:浏览器之间的实时通信
- 该规范中“RTCPeerConnection.onicecandidate”的定义。
{{ Spec2('WebRTC 1.0') }}Initial specification.
- -

浏览器兼容性

- - - -

{{Compat("api.RTCPeerConnection.onicecandidate")}}

- -

See also

- - diff --git a/files/zh-cn/web/api/rtcpeerconnection/ontrack/index.html b/files/zh-cn/web/api/rtcpeerconnection/ontrack/index.html deleted file mode 100644 index 84c2b49cfe..0000000000 --- a/files/zh-cn/web/api/rtcpeerconnection/ontrack/index.html +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: RTCPeerConnection.ontrack -slug: Web/API/RTCPeerConnection/ontrack -translation_of: Web/API/RTCPeerConnection/ontrack ---- -

{{APIRef("WebRTC")}}{{SeeCompatTable}}RTCPeerConnection.ontrack 属性是一个 {{event("Event_handlers", "event handler")}} 此属性指定了在{{domxref("RTCPeerConnection")}}接口上触发 {{event("track")}} 事件时调用的方法。该方法接收一个{{domxref("RTCTrackEvent")}}类型的event对象,该event对象将在{{domxref("MediaStreamTrack")}}被创建时或者是关联到已被添加到接收集合的{{domxref("RTCRtpReceiver")}}对象中时被发送。

- -

语法

- -
RTCPeerConnection.ontrack = eventHandler;
-
- -

参数

- -

ontrack设置为你提供的一个输入{{domxref("RTCTrackEvent")}}对象用于描述新的track将如何使用的方法。这一信息包含了代表新track的{{domxref("MediaStreamTrack")}}对象、{{domxref("RTCRtpReceiver")}}对象、{{domxref("RTCRtpTransceiver")}}对象以及一个{{domxref("MediaStream")}}对象列表,该对象列表表示该track是那个媒体流的一部分。

- -

示例

- -

本示例,从这篇文章的代码和视频调用的代码中,将传入的轨迹连接到将用于显示传入{{HTMLElement("video")}}元素。

- -
pc.ontrack = function(event) {
-  document.getElementById("received_video").srcObject = event.streams[0];
-  document.getElementById("hangup-button").disabled = false;
-};
-
- -

在第一行代码中,我们的ontrack 事件处理器获取传入的第媒体流数组中的第一个,并赋值给video元素的{{htmlattrxref("srcObject", "video")}} 。这样媒体流就和页面中的video元素结合起来以便于呈现给用户。第二行代码简单启用了“挂断”按钮,用户可以使用它去断开呼叫。

- -

说明

- - - - - - - - - - - - - - - - -
说明状态注释
{{SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-ontrack', 'RTCPeerConnection.ontrack')}}{{Spec2('WebRTC 1.0')}}初始规范
- -

各浏览器兼容性

- -{{Compat("api.RTCPeerConnection.ontrack")}} - -

参见

- - diff --git a/files/zh-cn/web/api/rtcpeerconnection/track_event/index.html b/files/zh-cn/web/api/rtcpeerconnection/track_event/index.html new file mode 100644 index 0000000000..0d121a93b6 --- /dev/null +++ b/files/zh-cn/web/api/rtcpeerconnection/track_event/index.html @@ -0,0 +1,57 @@ +--- +title: RTCPeerConnection.ontrack +slug: Web/API/RTCPeerConnection/track_event +translation_of: Web/API/RTCPeerConnection/ontrack +original_slug: Web/API/RTCPeerConnection/ontrack +--- +

{{APIRef("WebRTC")}}{{SeeCompatTable}}RTCPeerConnection.ontrack 属性是一个 {{event("Event_handlers", "event handler")}} 此属性指定了在{{domxref("RTCPeerConnection")}}接口上触发 {{event("track")}} 事件时调用的方法。该方法接收一个{{domxref("RTCTrackEvent")}}类型的event对象,该event对象将在{{domxref("MediaStreamTrack")}}被创建时或者是关联到已被添加到接收集合的{{domxref("RTCRtpReceiver")}}对象中时被发送。

+ +

语法

+ +
RTCPeerConnection.ontrack = eventHandler;
+
+ +

参数

+ +

ontrack设置为你提供的一个输入{{domxref("RTCTrackEvent")}}对象用于描述新的track将如何使用的方法。这一信息包含了代表新track的{{domxref("MediaStreamTrack")}}对象、{{domxref("RTCRtpReceiver")}}对象、{{domxref("RTCRtpTransceiver")}}对象以及一个{{domxref("MediaStream")}}对象列表,该对象列表表示该track是那个媒体流的一部分。

+ +

示例

+ +

本示例,从这篇文章的代码和视频调用的代码中,将传入的轨迹连接到将用于显示传入{{HTMLElement("video")}}元素。

+ +
pc.ontrack = function(event) {
+  document.getElementById("received_video").srcObject = event.streams[0];
+  document.getElementById("hangup-button").disabled = false;
+};
+
+ +

在第一行代码中,我们的ontrack 事件处理器获取传入的第媒体流数组中的第一个,并赋值给video元素的{{htmlattrxref("srcObject", "video")}} 。这样媒体流就和页面中的video元素结合起来以便于呈现给用户。第二行代码简单启用了“挂断”按钮,用户可以使用它去断开呼叫。

+ +

说明

+ + + + + + + + + + + + + + + + +
说明状态注释
{{SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-ontrack', 'RTCPeerConnection.ontrack')}}{{Spec2('WebRTC 1.0')}}初始规范
+ +

各浏览器兼容性

+ +{{Compat("api.RTCPeerConnection.ontrack")}} + +

参见

+ + diff --git a/files/zh-cn/web/api/serviceworker/onstatechange/index.html b/files/zh-cn/web/api/serviceworker/onstatechange/index.html deleted file mode 100644 index 94807435b2..0000000000 --- a/files/zh-cn/web/api/serviceworker/onstatechange/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: ServiceWorker.onstatechange -slug: Web/API/ServiceWorker/onstatechange -translation_of: Web/API/ServiceWorker/onstatechange ---- -
{{SeeCompatTable}}{{APIRef("Service Workers API")}}
- -

一个 {{domxref("EventListener")}} 联动的属性,其会被任何stagechange类型事件抛出时联动; 它也基本上能在任何时候{{domxref("ServiceWorker.state")}} 改变时被抛出.

- -

语法

- -
ServiceWorker.onstatechange = function(statechangeevent) { ... }
-ServiceWorker.addEventListener('statechange', function(statechangeevent) { ... } )
- -

示例

- -

这段代码出自 service worker registration-events sample (live demo). 它会监听 {{domxref("ServiceWorker.state")}} 的改变并返回它的值.

- -
var serviceWorker;
-if (registration.installing) {
-  serviceWorker = registration.installing;
-  document.querySelector('#kind').textContent = 'installing';
-} else if (registration.waiting) {
-  serviceWorker = registration.waiting;
-  document.querySelector('#kind').textContent = 'waiting';
-} else if (registration.active) {
-  serviceWorker = registration.active;
-  document.querySelector('#kind').textContent = 'active';
-}
-
-if (serviceWorker) {
-  logState(serviceWorker.state);
-  serviceWorker.addEventListener('statechange', function(e) {
-  logState(e.target.state);
-  });
-}
- -

注意当statechange 抛出时, service worker的引用可能已经改变。例如:

- -
navigator.serviceWorker.register(..).then(function(swr) {
-  swr.installing.state == "installing"
-  swr.installing.onstatechange = function() {
-    swr.installing == null;
-    // At this point, swr.waiting OR swr.active might be true. This is because the statechange
-    // event gets queued, meanwhile the underlying worker may have gone into the waiting
-    // state and will be immediately activated if possible.
-  }
-})
- -

规范

- - - - - - - - - - - - - - -
规范状态附注
{{SpecName('Service Workers', '#service-worker-onstatechange-attribute', 'ServiceWorker.onstatechange')}}{{Spec2('Service Workers')}}Initial definition
- -

浏览器兼容性

- -{{Compat("api.ServiceWorker.onstatechange")}} diff --git a/files/zh-cn/web/api/serviceworker/statechange_event/index.html b/files/zh-cn/web/api/serviceworker/statechange_event/index.html new file mode 100644 index 0000000000..c14f156198 --- /dev/null +++ b/files/zh-cn/web/api/serviceworker/statechange_event/index.html @@ -0,0 +1,70 @@ +--- +title: ServiceWorker.onstatechange +slug: Web/API/ServiceWorker/statechange_event +translation_of: Web/API/ServiceWorker/onstatechange +original_slug: Web/API/ServiceWorker/onstatechange +--- +
{{SeeCompatTable}}{{APIRef("Service Workers API")}}
+ +

一个 {{domxref("EventListener")}} 联动的属性,其会被任何stagechange类型事件抛出时联动; 它也基本上能在任何时候{{domxref("ServiceWorker.state")}} 改变时被抛出.

+ +

语法

+ +
ServiceWorker.onstatechange = function(statechangeevent) { ... }
+ServiceWorker.addEventListener('statechange', function(statechangeevent) { ... } )
+ +

示例

+ +

这段代码出自 service worker registration-events sample (live demo). 它会监听 {{domxref("ServiceWorker.state")}} 的改变并返回它的值.

+ +
var serviceWorker;
+if (registration.installing) {
+  serviceWorker = registration.installing;
+  document.querySelector('#kind').textContent = 'installing';
+} else if (registration.waiting) {
+  serviceWorker = registration.waiting;
+  document.querySelector('#kind').textContent = 'waiting';
+} else if (registration.active) {
+  serviceWorker = registration.active;
+  document.querySelector('#kind').textContent = 'active';
+}
+
+if (serviceWorker) {
+  logState(serviceWorker.state);
+  serviceWorker.addEventListener('statechange', function(e) {
+  logState(e.target.state);
+  });
+}
+ +

注意当statechange 抛出时, service worker的引用可能已经改变。例如:

+ +
navigator.serviceWorker.register(..).then(function(swr) {
+  swr.installing.state == "installing"
+  swr.installing.onstatechange = function() {
+    swr.installing == null;
+    // At this point, swr.waiting OR swr.active might be true. This is because the statechange
+    // event gets queued, meanwhile the underlying worker may have gone into the waiting
+    // state and will be immediately activated if possible.
+  }
+})
+ +

规范

+ + + + + + + + + + + + + + +
规范状态附注
{{SpecName('Service Workers', '#service-worker-onstatechange-attribute', 'ServiceWorker.onstatechange')}}{{Spec2('Service Workers')}}Initial definition
+ +

浏览器兼容性

+ +{{Compat("api.ServiceWorker.onstatechange")}} diff --git a/files/zh-cn/web/http/headers/cookie2/index.html b/files/zh-cn/web/http/headers/cookie2/index.html deleted file mode 100644 index 24699b5103..0000000000 --- a/files/zh-cn/web/http/headers/cookie2/index.html +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: Cookie2 -slug: Web/HTTP/Headers/Cookie2 -tags: - - 废弃 - - 请求首部 - - 首部 -translation_of: Web/HTTP/Headers/Cookie2 ---- -
{{HTTPSidebar}} {{obsolete_header}}
- -

这个已经被废弃的 Cookie2 请求首部曾经被用来告知浏览器该用户代理支持“新型” cookies,但是现代的用户代理一般使用 {{HTTPHeader("Cookie")}} 来替代 Cookie2

- - - - - - - - - - - - -
Header type{{Glossary("Request header")}}
{{Glossary("Forbidden header name")}}yes
- -

示例

- -
Cookie2: $Version="1"
- -

规范

- - - - - - - - - - - - -
SpecificationTitle
{{RFC("2965", "Cookie2")}}Historic specification of HTTP State Management Mechanism, obsoleted by {{RFC("6265")}}
- -

浏览器兼容性

- -

{{Compat("http.headers.Cookie2")}}

- -

相关内容

- - diff --git a/files/zh-cn/web/http/headers/set-cookie2/index.html b/files/zh-cn/web/http/headers/set-cookie2/index.html deleted file mode 100644 index 117497bd4b..0000000000 --- a/files/zh-cn/web/http/headers/set-cookie2/index.html +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: Set-Cookie2 -slug: Web/HTTP/Headers/Set-Cookie2 -tags: - - 废止 - - 首部 -translation_of: Web/HTTP/Headers/Set-Cookie2 ---- -
{{HTTPSidebar}} {{obsolete_header}}
- -

Set-Cookie2 是一个响应首部,已废弃使用。它被服务器用来向客户端发送 cookie 数据,但是已经在协议中被标记为不赞成使用了。请使用 {{HTTPHeader("Set-Cookie")}}  将其代替。

- - - - - - - - - - - - -
Header type{{Glossary("Response header")}}
{{Glossary("Forbidden header name")}}no
- -

语法

- -
Set-Cookie2: <cookie-name>=<cookie-value>
-Set-Cookie2: <cookie-name>=<cookie-value>; Comment=<value>
-Set-Cookie2: <cookie-name>=<cookie-value>; CommentURL=<http-url>
-Set-Cookie2: <cookie-name>=<cookie-value>; Discard
-Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>
-Set-Cookie2: <cookie-name>=<cookie-value>; Max-Age=<non-zero-digit>
-Set-Cookie2: <cookie-name>=<cookie-value>; Path=<path-value>
-Set-Cookie2: <cookie-name>=<cookie-value>; Port=<port-number>
-Set-Cookie2: <cookie-name>=<cookie-value>; Secure
-Set-Cookie2: <cookie-name>=<cookie-value>; Version=<version-number>
-
-// Multiple directives are also possible, for example:
-Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>; Secure
-
-// Multiple cookies are seperated by a comma
-Set-Cookie2: <cookie-name>=<cookie-value>, <cookie-name>=<cookie-value>, ...
-
- -

规范

- - - - - - - - - - - - -
SpecificationTitle
{{RFC("2965", "Set-Cookie2")}}Historic specification of HTTP State Management Mechanism, obsoleted by {{RFC("6265")}}
- -

浏览器兼容性

- -

{{Compat("http.headers.Set-Cookie2")}}

- -

相关内容

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