aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/http/headers/content-security-policy/prefetch-src/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/fr/web/http/headers/content-security-policy/prefetch-src/index.html')
-rw-r--r--files/fr/web/http/headers/content-security-policy/prefetch-src/index.html88
1 files changed, 88 insertions, 0 deletions
diff --git a/files/fr/web/http/headers/content-security-policy/prefetch-src/index.html b/files/fr/web/http/headers/content-security-policy/prefetch-src/index.html
new file mode 100644
index 0000000000..81d2f5f0fa
--- /dev/null
+++ b/files/fr/web/http/headers/content-security-policy/prefetch-src/index.html
@@ -0,0 +1,88 @@
+---
+title: 'CSP: prefetch-src'
+slug: Web/HTTP/Headers/Content-Security-Policy/prefetch-src
+tags:
+ - CSP
+ - Content-Security-Policy
+ - Directive
+ - HTTP
+ - Reference
+ - prefetch-src
+ - source
+translation_of: Web/HTTP/Headers/Content-Security-Policy/prefetch-src
+---
+<div>{{HTTPSidebar}}</div>
+
+<p>La directive HTTP {{HTTPHeader("Content-Security-Policy")}} (CSP) <code><strong>prefetch-src</strong></code> spécifie les ressources pouvant être préchargées ou préaffichées.</p>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row">Version de CSP</th>
+ <td>3</td>
+ </tr>
+ <tr>
+ <th scope="row">Type de directive</th>
+ <td>{{Glossary("Fetch directive")}}</td>
+ </tr>
+ <tr>
+ <th scope="row">{{CSP("default-src")}} par défaut</th>
+ <td>Oui, si cette directive est absente, l'agent utilisateur consultera la directive <code>default-src</code></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Syntaxe">Syntaxe</h2>
+
+<p>Une ou plusieurs sources peuvent être autorisées pour cette directive :</p>
+
+<pre class="syntaxbox notranslate">Content-Security-Policy: prefetch-src &lt;source&gt;;
+Content-Security-Policy: prefetch-src &lt;source&gt; &lt;source&gt;;
+</pre>
+
+<h3 id="Sources">Sources</h3>
+
+<p>{{page("/fr/docs/Web/HTTP/Headers/Content-Security-Policy/default-src", "common_sources")}}</p>
+
+<h2 id="Exemple">Exemple</h2>
+
+<h3 id="Cas_de_violation">Cas de violation</h3>
+
+<p>Soit cet en-tête CSP :</p>
+
+<pre class="notranslate">Content-Security-Policy: prefetch-src https://example.com/
+</pre>
+
+<p>Les requêtes émises par ce code généreront des erreurs de réseau puisque les URL demandées ne correspondant pas à la liste de permissions de la directive <code>prefetch-src</code> :</p>
+
+<pre class="notranslate">&lt;link rel="prefetch" src="https://example.org/"&gt;&lt;/link&gt;
+&lt;link rel="prerender" src="https://example.org/"&gt;&lt;/link&gt;</pre>
+
+<h2 id="Spécification">Spécification</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Spécification</th>
+ <th scope="col">Statut</th>
+ <th scope="col">Commentaire</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{specName("CSP 3.0", "#prefetch-src", "prefetch-src")}}</td>
+ <td>{{Spec2("CSP 3.0")}}</td>
+ <td>Définition initiale.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
+
+<p>{{Compat("http.headers.csp.Content-Security-Policy.prefetch-src")}}</p>
+
+<h2 id="Voir_aussi">Voir aussi</h2>
+
+<ul>
+ <li>{{HTTPHeader("Content-Security-Policy")}}</li>
+</ul>