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/fr/web/api/clients/matchall/index.html | 130 +++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 files/fr/web/api/clients/matchall/index.html (limited to 'files/fr/web/api/clients/matchall') diff --git a/files/fr/web/api/clients/matchall/index.html b/files/fr/web/api/clients/matchall/index.html new file mode 100644 index 0000000000..6b17e793b9 --- /dev/null +++ b/files/fr/web/api/clients/matchall/index.html @@ -0,0 +1,130 @@ +--- +title: Clients.matchAll() +slug: Web/API/Clients/matchAll +tags: + - API + - Client + - Expérimental(2) + - Méthode + - Référence(2) + - Service Workers +translation_of: Web/API/Clients/matchAll +--- +
{{SeeCompatTable}}{{APIRef("Service Workers API")}}
+ +
La méthode matchAll() de l'interface {{domxref("Clients")}} retourne une Promesse pour une liste de service worker clients. Inclure le paramètre options permet de retourner tous les services worker clients dont l'origine est la même que l'origine du service worker associé. Si options n'est pas inclus, la méthode retourne que le service worker client controllé par le service worker.
+ +
 
+ +

Syntaxe

+ +
ServiceWorkerClients.matchAll(options).then(function(clients) {
+  // faire quelque chose avec la list de clients
+});
+ +

Paramètres

+ +
+
options
+
L'objet option vous permet de définir les options pour l'opération. Les options disponibles sont : +
    +
  • includeUncontrolled: Un {{domxref("Boolean")}} — défini à true, l'opération retournera tous les services worker clients qui sont de la même origine que le service worker courant. Sinon, elle ne retournera que le service worker client controllé par le service worker courant. La valeur par défaut est false.
  • +
  • type: Défini le type de client que vous voulez observer. Les types disponibles sont window, worker, sharedworker, et all. La valeur par défaut est all.
  • +
+
+
+ +

Valeur de retour

+ +
+
Une  Promesse qui se résout avec un tableau d'objets {{domxref("Client")}}.
+
+ +

Exemples

+ +
clients.matchAll(options).then(function(clientList) {
+  for(var i = 0 ; i < clients.length ; i++) {
+    if(clientList[i].url === 'index.html') {
+      clients.openWindow(clientList[i]);
+      // ou faire quelque chose avec le client
+    }
+  }
+});
+ +

Spécifications

+ + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('Service Workers', '#clients', 'Clients')}}{{Spec2('Service Workers')}}Définition initial.
+ +

Compatibilité des navigateurs

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FonctionnalitéChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Support de base{{CompatChrome(40.0)}}[1]{{ CompatGeckoDesktop("44.0") }}[2]{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FonctionnalitéAndroidAndroid WebviewFirefox Mobile (Gecko)Firefox OSIE MobileOpera MobileSafari MobileChrome for Android
Support de base{{CompatNo}}{{CompatChrome(40.0)}}[1]{{ CompatGeckoMobile("44.0") }}{{ CompatVersionUnknown }}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}{{CompatChrome(40.0)}}
+
+ + -- cgit v1.2.3-54-g00ecf