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/focus/index.html | 73 -------------------------- files/fr/web/api/windowclient/focus/index.md | 73 ++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 73 deletions(-) delete mode 100644 files/fr/web/api/windowclient/focus/index.html create mode 100644 files/fr/web/api/windowclient/focus/index.md (limited to 'files/fr/web/api/windowclient/focus') diff --git a/files/fr/web/api/windowclient/focus/index.html b/files/fr/web/api/windowclient/focus/index.html deleted file mode 100644 index b78542bb67..0000000000 --- a/files/fr/web/api/windowclient/focus/index.html +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: WindowClient.focus() -slug: Web/API/WindowClient/focus -tags: - - API - - Client - - Experimental - - Focus - - Method - - Reference - - Service Workers - - WindowClient -translation_of: Web/API/WindowClient/focus ---- -

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

- -

La méthode focus() de l'interface {{domxref("WindowClient")}} focus le client en cours et retourne une {{jsxref("Promise")}} qui est résolue vers le {{domxref("WindowClient")}} existant.

- -

Syntaxe

- -
Client.focus().then(function(WindowClient) {
-  // utilisez le WindowClient une fois qu'il est focus
-});
- -

Paramètres

- -

Nil.

- -

Valeur de retour

- -

Une {{jsxref("Promise")}} qui est résolue vers le {{domxref("WindowClient")}} existant.

- -

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', '#client-focus-method', 'focus()')}}{{Spec2('Service Workers')}}Définition initiale..
- -

Compatibilité des navigateurs

- -

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

diff --git a/files/fr/web/api/windowclient/focus/index.md b/files/fr/web/api/windowclient/focus/index.md new file mode 100644 index 0000000000..b78542bb67 --- /dev/null +++ b/files/fr/web/api/windowclient/focus/index.md @@ -0,0 +1,73 @@ +--- +title: WindowClient.focus() +slug: Web/API/WindowClient/focus +tags: + - API + - Client + - Experimental + - Focus + - Method + - Reference + - Service Workers + - WindowClient +translation_of: Web/API/WindowClient/focus +--- +

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

+ +

La méthode focus() de l'interface {{domxref("WindowClient")}} focus le client en cours et retourne une {{jsxref("Promise")}} qui est résolue vers le {{domxref("WindowClient")}} existant.

+ +

Syntaxe

+ +
Client.focus().then(function(WindowClient) {
+  // utilisez le WindowClient une fois qu'il est focus
+});
+ +

Paramètres

+ +

Nil.

+ +

Valeur de retour

+ +

Une {{jsxref("Promise")}} qui est résolue vers le {{domxref("WindowClient")}} existant.

+ +

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', '#client-focus-method', 'focus()')}}{{Spec2('Service Workers')}}Définition initiale..
+ +

Compatibilité des navigateurs

+ +

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

-- cgit v1.2.3-54-g00ecf