From c05efa8d7ae464235cf83d7c0956e42dc6974103 Mon Sep 17 00:00:00 2001 From: julieng Date: Sat, 2 Oct 2021 17:20:14 +0200 Subject: move *.html to *.md --- files/fr/web/api/windowclient/index.html | 92 -------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 files/fr/web/api/windowclient/index.html (limited to 'files/fr/web/api/windowclient/index.html') diff --git a/files/fr/web/api/windowclient/index.html b/files/fr/web/api/windowclient/index.html deleted file mode 100644 index 1a7d646b7a..0000000000 --- a/files/fr/web/api/windowclient/index.html +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: WindowClient -slug: Web/API/WindowClient -tags: - - API - - Client - - Experimental - - Interface - - Reference - - Service Workers - - ServiceWorker - - WindowClient -translation_of: Web/API/WindowClient ---- -

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

- -

L'interface WindowClient de l'API ServiceWorker représente la portée d'un client service worker lorsque celui-ci existe en tant que document dans un contexte navigateur, controlé par un worker actif. Le client sélectionne et utilise un service worker pour son propre chargement et celui de ses sous-ressources.

- -

Méthodes

- -

WindowClient hérite certaines méthodes de son parent, {{domxref("Client")}}.

- -
-
{{domxref("WindowClient.focus()")}}
-
Assigne le focus au client en cours.
-
{{domxref("WindowClient.navigate()")}}
-
Charge l'url spécifiée dans la page en cours.
-
- -

Propriétés

- -

WindowClient hérite certaines propriétés de son parent, {{domxref("Client")}}.

- -
-
{{domxref("WindowClient.focused")}} {{readonlyInline}}
-
Un booléen qui indique si oui ou non le client en cours est focus.
-
{{domxref("WindowClient.visibilityState")}} {{readonlyInline}}
-
Indique la visibilité du client en cours. Peut prendre les valeures hidden, visible, prerender, ou unloaded.
-
- -

Exemple

- -
self.addEventListener('notificationclick', function(event) {
-  console.log('On notification click: ', event.notification.tag);
-  event.notification.close();
-
-  // Vérifie si le client en cours est ouvert et
-  // le focus le cas échéant
-  event.waitUntil(clients.matchAll({
-    type: "window"
-  }).then(function(clientList) {
-    for (var i = 0; i < clientList.length; i++) {
-      var client = clientList[i];
-      if (client.url == '/' && 'focus' in client)
-        return client.focus();
-    }
-    if (clients.openWindow)
-      return clients.openWindow('/');
-  }));
-});
- -

Spécifications

- - - - - - - - - - - - - - -
SpécificationÉtatCommentaires
{{SpecName('Service Workers', '#window-client-interface', 'WindowClient')}}{{Spec2('Service Workers')}}Définition initiale.
- -

Compatibilité des navigateurs

- -

{{Compat("api.WindowClient")}}

- -

Voir aussi

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