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/client/url/index.html | 68 ---------------------------------- files/fr/web/api/client/url/index.md | 68 ++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 68 deletions(-) delete mode 100644 files/fr/web/api/client/url/index.html create mode 100644 files/fr/web/api/client/url/index.md (limited to 'files/fr/web/api/client/url') diff --git a/files/fr/web/api/client/url/index.html b/files/fr/web/api/client/url/index.html deleted file mode 100644 index e024102c50..0000000000 --- a/files/fr/web/api/client/url/index.html +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: Client.url -slug: Web/API/Client/url -tags: - - API - - Client - - Experimental - - Property - - Reference - - ServiceWorkers - - URL -translation_of: Web/API/Client/url ---- -
{{SeeCompatTable}}{{APIRef("Service Workers API")}}
- -
La propriété url (lecture seule) de l'interface {{domxref("Client")}} retourne l'url du service worker client courant.
- -
 
- -

Syntaxe

- -
var clientUrl = Client.url;
- -

Valeur de retour

- -

Valeur de type {{domxref("USVString")}}.

- -

Exemple

- -
self.addEventListener('notificationclick', function(event) {
-  console.log('Au click de notification : ', event.notification.tag);
-  event.notification.close();
-
-  // Vérification pour savoir si l'évenement est ouvert et
-  // se focalise dessus si c'est le cas
-  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écificationStatutCommentaire
{{SpecName('Service Workers', '#client-url', 'url')}}{{Spec2('Service Workers')}}Défintion initiale.
- -

Compatibilité des navigateurs

- -

{{Compat("api.Client.url")}}

diff --git a/files/fr/web/api/client/url/index.md b/files/fr/web/api/client/url/index.md new file mode 100644 index 0000000000..e024102c50 --- /dev/null +++ b/files/fr/web/api/client/url/index.md @@ -0,0 +1,68 @@ +--- +title: Client.url +slug: Web/API/Client/url +tags: + - API + - Client + - Experimental + - Property + - Reference + - ServiceWorkers + - URL +translation_of: Web/API/Client/url +--- +
{{SeeCompatTable}}{{APIRef("Service Workers API")}}
+ +
La propriété url (lecture seule) de l'interface {{domxref("Client")}} retourne l'url du service worker client courant.
+ +
 
+ +

Syntaxe

+ +
var clientUrl = Client.url;
+ +

Valeur de retour

+ +

Valeur de type {{domxref("USVString")}}.

+ +

Exemple

+ +
self.addEventListener('notificationclick', function(event) {
+  console.log('Au click de notification : ', event.notification.tag);
+  event.notification.close();
+
+  // Vérification pour savoir si l'évenement est ouvert et
+  // se focalise dessus si c'est le cas
+  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écificationStatutCommentaire
{{SpecName('Service Workers', '#client-url', 'url')}}{{Spec2('Service Workers')}}Défintion initiale.
+ +

Compatibilité des navigateurs

+ +

{{Compat("api.Client.url")}}

-- cgit v1.2.3-54-g00ecf