diff options
| author | julieng <julien.gattelier@gmail.com> | 2021-10-02 17:20:14 +0200 |
|---|---|---|
| committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-10-02 17:30:20 +0200 |
| commit | c05efa8d7ae464235cf83d7c0956e42dc6974103 (patch) | |
| tree | 6ea911b2f2010f63a026de6bb7a1a51e7690a7e1 /files/fr/web/api/windowclient/focus/index.html | |
| parent | 13a5e017558b248ee1647d4a5825f183b51f09ad (diff) | |
| download | translated-content-c05efa8d7ae464235cf83d7c0956e42dc6974103.tar.gz translated-content-c05efa8d7ae464235cf83d7c0956e42dc6974103.tar.bz2 translated-content-c05efa8d7ae464235cf83d7c0956e42dc6974103.zip | |
move *.html to *.md
Diffstat (limited to 'files/fr/web/api/windowclient/focus/index.html')
| -rw-r--r-- | files/fr/web/api/windowclient/focus/index.html | 73 |
1 files changed, 0 insertions, 73 deletions
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 ---- -<p>{{SeeCompatTable}}{{APIRef("Service Workers API")}}</p> - -<p>La méthode <strong><code>focus()</code></strong> de l'interface {{domxref("WindowClient")}} focus le client en cours et retourne une {{jsxref("Promise")}} qui est résolue vers le {{domxref("WindowClient")}} existant.</p> - -<h2 id="Syntaxe">Syntaxe</h2> - -<pre class="syntaxbox">Client.focus().then(function(WindowClient) { - // utilisez le WindowClient une fois qu'il est focus -});</pre> - -<h3 id="Paramètres">Paramètres</h3> - -<p>Nil.</p> - -<h3 id="Valeur_de_retour">Valeur de retour</h3> - -<p>Une {{jsxref("Promise")}} qui est résolue vers le {{domxref("WindowClient")}} existant.</p> - -<h2 id="Exemple">Exemple</h2> - -<pre class="brush: js">self.addEventListener('notificationclick', function(event) { - console.log('On notification click: ', event.notification.tag); - event.notification.close(); - -<code> // Vérifie si le client en cours est ouvert et - // le focus le cas échéant</code> - 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('/'); - })); -});</pre> - -<h2 id="Spécifications">Spécifications</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Spécification</th> - <th scope="col">État</th> - <th scope="col">Commentaires</th> - </tr> - <tr> - <td>{{SpecName('Service Workers', '#client-focus-method', 'focus()')}}</td> - <td>{{Spec2('Service Workers')}}</td> - <td>Définition initiale..</td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> - -<p>{{Compat("api.WindowClient.focus")}}</p> |
