diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
| commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
| tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/fr/web/api/window/issecurecontext | |
| parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
| download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip | |
initial commit
Diffstat (limited to 'files/fr/web/api/window/issecurecontext')
| -rw-r--r-- | files/fr/web/api/window/issecurecontext/index.html | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/files/fr/web/api/window/issecurecontext/index.html b/files/fr/web/api/window/issecurecontext/index.html new file mode 100644 index 0000000000..af14866f13 --- /dev/null +++ b/files/fr/web/api/window/issecurecontext/index.html @@ -0,0 +1,60 @@ +--- +title: Window.isSecureContext +slug: Web/API/Window/isSecureContext +tags: + - API + - Propriété + - Reference + - Sécurité + - Window +translation_of: Web/API/Window/isSecureContext +--- +<p>{{APIRef}}{{SeeCompatTable}}</p> + +<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> + +<h2 id="Syntaxe">Syntaxe</h2> + +<pre class="syntaxbox notranslate">var <em>isSecure</em> = window.isSecureContext</pre> + +<h2 id="Exemples">Exemples</h2> + +<h3 id="Détection_des_fonctionnalités">Détection des fonctionnalités</h3> + +<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> + +<pre class="brush: js notranslate">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> + +<div class="hidden">Le tableau de compatibilité de cette page est généré à partir de données structurées. Si vous souhaitez contribuer aux données, veuillez consulter <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> et envoyez-nous une pull request.</div> + +<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> |
