diff options
author | julieng <julien.gattelier@gmail.com> | 2021-10-02 17:20:24 +0200 |
---|---|---|
committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-10-02 17:30:20 +0200 |
commit | 1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde (patch) | |
tree | 30a56efd3eff3a01bd1611e1840fdbbfacf544a4 /files/fr/web/api/window/issecurecontext | |
parent | c05efa8d7ae464235cf83d7c0956e42dc6974103 (diff) | |
download | translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.tar.gz translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.tar.bz2 translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.zip |
convert content to md
Diffstat (limited to 'files/fr/web/api/window/issecurecontext')
-rw-r--r-- | files/fr/web/api/window/issecurecontext/index.md | 61 |
1 files changed, 25 insertions, 36 deletions
diff --git a/files/fr/web/api/window/issecurecontext/index.md b/files/fr/web/api/window/issecurecontext/index.md index dd6a2dbbc3..0e998ab741 100644 --- a/files/fr/web/api/window/issecurecontext/index.md +++ b/files/fr/web/api/window/issecurecontext/index.md @@ -9,50 +9,39 @@ tags: - Window translation_of: Web/API/Window/isSecureContext --- -<p>{{APIRef}}{{SeeCompatTable}}</p> +{{APIRef}}{{SeeCompatTable}} -<p>La propriété en lecteur seule <code><strong>window.isSecureContext</strong></code> indique si un contexte est capable d'utiliser des fonctionnalités qui nécessitent des <a href="/en-US/docs/Web/Security/Secure_Contexts">contextes sécurisés</a>.</p> +La propriété en lecteur seule **`window.isSecureContext`** indique si un contexte est capable d'utiliser des fonctionnalités qui nécessitent des [contextes sécurisés](/en-US/docs/Web/Security/Secure_Contexts). -<h2 id="Syntaxe">Syntaxe</h2> +## Syntaxe -<pre class="syntaxbox">var <em>isSecure</em> = window.isSecureContext</pre> + var isSecure = window.isSecureContext -<h2 id="Exemples">Exemples</h2> +## Exemples -<h3 id="Détection_des_fonctionnalités">Détection des fonctionnalités</h3> +### Détection des fonctionnalités -<p>Vous pouvez utiliser la détection des fonctionnalités pour vérifier si elles sont dans un contexte sécurisé ou non à l'aide du booléen <code>isSecureContext</code> qui est exposé sur la portée globale.</p> +Vous pouvez utiliser la détection des fonctionnalités pour vérifier si elles sont dans un contexte sécurisé ou non à l'aide du booléen `isSecureContext` qui est exposé sur la portée globale. -<pre class="brush: js">if (window.isSecureContext) { +```js +if (window.isSecureContext) { // La page est un contexte sécurisé afin que les techniciens de service soient désormais disponibles navigator.serviceWorker.register("/offline-worker.js").then(function () { ... }); -}</pre> - -<h2 id="Spécifications">Spécifications</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th>Spécification</th> - <th>Statut</th> - <th>Commentaire</th> - </tr> - <tr> - <td>{{SpecName('Secure Contexts')}}</td> - <td>{{Spec2('Secure Contexts','#monkey-patching-global-object','isSecureContext')}}</td> - <td>Spécification initiale.</td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> - -<p>{{Compat("api.Window.isSecureContext")}}</p> - -<h2 id="Voir_également">Voir également</h2> - -<ul> - <li><a href="/en-US/docs/Web/Security/Secure_Contexts">Contextes sécurisés</a></li> -</ul> +} +``` + +## Spécifications + +| Spécification | Statut | Commentaire | +| ---------------------------------------- | -------------------------------------------------------------------------------------------------------- | ----------------------- | +| {{SpecName('Secure Contexts')}} | {{Spec2('Secure Contexts','#monkey-patching-global-object','isSecureContext')}} | Spécification initiale. | + +## Compatibilité des navigateurs + +{{Compat("api.Window.isSecureContext")}} + +## Voir également + +- [Contextes sécurisés](/en-US/docs/Web/Security/Secure_Contexts) |