From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/fetchevent/clientid/index.html | 66 +++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 files/ja/web/api/fetchevent/clientid/index.html (limited to 'files/ja/web/api/fetchevent/clientid') diff --git a/files/ja/web/api/fetchevent/clientid/index.html b/files/ja/web/api/fetchevent/clientid/index.html new file mode 100644 index 0000000000..73666422a1 --- /dev/null +++ b/files/ja/web/api/fetchevent/clientid/index.html @@ -0,0 +1,66 @@ +--- +title: FetchEvent.clientId +slug: Web/API/FetchEvent/clientId +tags: + - API + - FetchEvent + - Property + - Reference + - Service Workers + - clientId +translation_of: Web/API/FetchEvent/clientId +--- +

{{APIRef("Service Workers API")}}

+ +

{{domxref("FetchEvent")}}インターフェイスの clientId 読み取り専用プロパティは、現在のサービスワーカーが制御している {{domxref("Client")}} の id を返します。

+ +

次に、{{domxref("Clients.get()")}} メソッドに、この id を渡して、関連するクライアントを取得できます。

+ +

構文

+ +
var myClientId = fetchEvent.clientId;
+ +

+ +

クライアント id を表す {{domxref("DOMString")}}。

+ +

+ +
self.addEventListener('fetch', function(event) {
+  console.log(event.clientId);
+​});
+ +

仕様

+ + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('Service Workers', '#dom-fetchevent-clientid', 'clientId')}}{{Spec2('Service Workers')}}初期定義
+ +

ブラウザーの互換性

+ +
+ + +

{{Compat("api.FetchEvent.clientId")}}

+
+ +

関連情報

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