aboutsummaryrefslogtreecommitdiff
path: root/files/fr/mozilla/add-ons/webextensions/api/browsingdata/removecookies/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/fr/mozilla/add-ons/webextensions/api/browsingdata/removecookies/index.html')
-rw-r--r--files/fr/mozilla/add-ons/webextensions/api/browsingdata/removecookies/index.html27
1 files changed, 13 insertions, 14 deletions
diff --git a/files/fr/mozilla/add-ons/webextensions/api/browsingdata/removecookies/index.html b/files/fr/mozilla/add-ons/webextensions/api/browsingdata/removecookies/index.html
index d8f30d2b33..dd543a2a24 100644
--- a/files/fr/mozilla/add-ons/webextensions/api/browsingdata/removecookies/index.html
+++ b/files/fr/mozilla/add-ons/webextensions/api/browsingdata/removecookies/index.html
@@ -27,7 +27,7 @@ translation_of: Mozilla/Add-ons/WebExtensions/API/browsingData/removeCookies
<h2 id="Syntaxe">Syntaxe</h2>
-<pre class="syntaxbox brush:js">var removing = browser.browsingData.removeCookies(
+<pre class="brush: js">var removing = browser.browsingData.removeCookies(
removalOptions // RemovalOptions object
)
</pre>
@@ -72,26 +72,25 @@ then(onRemoved, onError);</pre>
<p>Supprime tous les cookies :</p>
<div class="warning">
-<p><strong>Avertissement</strong><br>
- L'utilisation de l'API pour supprimer tous les cookies effacera simultanément tous les objets de stockage locaux (y compris ceux des autres extensions).<br>
- <br>
- Si vous souhaitez simplement effacer tous les cookies sans perturber les installations de stockage locales, utilisez <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies">browser.cookies</a> pour faire une boucle et supprimer le contenu de tous les magasins de cookies.</p>
+<p><strong>Attention :</strong></p>
+<p>L'utilisation de l'API pour supprimer tous les cookies effacera simultanément tous les objets de stockage locaux (y compris ceux des autres extensions).</p>
+<p>Si vous souhaitez simplement effacer tous les cookies sans perturber les installations de stockage locales, utilisez <a href="/fr/docs/Mozilla/Add-ons/WebExtensions/API/cookies">browser.cookies</a> pour faire une boucle et supprimer le contenu de tous les magasins de cookies.</p>
</div>
-<pre class="brush: js line-numbers language-js"><code class="language-js"><span class="keyword token">function</span> <span class="function token">onRemoved</span><span class="punctuation token">(</span><span class="punctuation token">)</span> <span class="punctuation token">{</span>
- console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span><span class="string token">"removed"</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
-<span class="punctuation token">}</span>
+<pre class="brush: js">function onRemoved() {
+ console.log("removed");
+}
-<span class="keyword token">function</span> <span class="function token">onError</span><span class="punctuation token">(</span>error<span class="punctuation token">)</span> <span class="punctuation token">{</span>
- console<span class="punctuation token">.</span><span class="function token">error</span><span class="punctuation token">(</span>error<span class="punctuation token">)</span><span class="punctuation token">;</span>
-<span class="punctuation token">}</span>
+function onError(error) {
+ console.error(error);
+}
-browser<span class="punctuation token">.</span>browsingData<span class="punctuation token">.</span><span class="function token">removeCookies</span><span class="punctuation token">(</span><span class="punctuation token">{</span><span class="punctuation token">}</span><span class="punctuation token">)</span><span class="punctuation token">.</span>
-<span class="function token">then</span><span class="punctuation token">(</span>onRemoved<span class="punctuation token">,</span> onError<span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre>
+browser.browsingData.removeCookies({}).
+then(onRemoved, onError);</pre>
<p>{{WebExtExamples}}</p>
-<div class="note"><strong>Remerciements :</strong>
+<div class="note"><p><strong>Note :</strong></p>
<p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/browsingData"><code>chrome.browsingData</code></a>.</p>