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/clients/matchall/index.html | 75 ++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 files/ja/web/api/clients/matchall/index.html (limited to 'files/ja/web/api/clients/matchall/index.html') diff --git a/files/ja/web/api/clients/matchall/index.html b/files/ja/web/api/clients/matchall/index.html new file mode 100644 index 0000000000..884ca3b3f5 --- /dev/null +++ b/files/ja/web/api/clients/matchall/index.html @@ -0,0 +1,75 @@ +--- +title: Clients.matchAll() +slug: Web/API/Clients/matchAll +tags: + - API + - Clients + - Method + - Reference + - Service Workers + - ServiceWorker +translation_of: Web/API/Clients/matchAll +--- +
{{APIRef("Service Workers API")}}
+ +

{{domxref("Clients")}} インターフェイスの matchAll() メソッドは、サービスワーカークライアント({{domxref("Client")}})オブジェクトのリストの {{jsxref("Promise")}} を返します。 関連するサービスワーカーのオリジンと同じオリジンを持つすべてのサービスワーカークライアントを返すには、options パラメーターを含めます。 オプションが含まれていない場合、メソッドは、サービスワーカーによって制御されるサービスワーカークライアントのみを返します。

+ +

構文

+ +
self.clients.matchAll(options).then(function(clients) {
+  // クライアントのリストで何かを行います
+});
+ +

パラメーター

+ +
+
options {{optional_inline}}
+
照合操作のオプションを設定できるオプションオブジェクト。 利用可能なオプションは次のとおりです。 +
    +
  • includeUncontrolled: {{jsxref("Boolean")}} — true に設定すると、照合操作は、現在のサービスワーカーと同じオリジンを共有するすべてのクライアントを返します。 それ以外の場合は、現在のサービスワーカーによって制御されているサービスワーカークライアントのみを返します。 デフォルトは false です。
  • +
  • type: 一致させるクライアントの種類を設定します。 使用可能な値は、"window""worker""sharedworker""all" です。 デフォルトは "all" です。
  • +
+
+
+ +

戻り値

+ +
+
{{domxref("Client")}} オブジェクトの配列に解決される {{jsxref("Promise")}}。 Chrome 46 / Firefox 54 以降では、このメソッドはクライアントを直近でフォーカスした順序で返し、仕様どおりに修正されます。
+
+ +

+ +
clients.matchAll(options).then(function(clientList) {
+  for (var i = 0 ; i < clientList.length ; i++) {
+    if (clientList[i].url === 'index.html') {
+      clients.openWindow(clientList[i]);
+      // または、一致するクライアントに関係する何かを行う
+    }
+  }
+});
+ +

仕様

+ + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('Service Workers', '#clients-matchall', 'Clients: matchall')}}{{Spec2('Service Workers')}}初期定義
+ +

ブラウザーの互換性

+ +
+ + +

{{Compat("api.Clients.matchAll")}}

+
-- cgit v1.2.3-54-g00ecf