diff options
Diffstat (limited to 'files/fr/mozilla/add-ons/webextensions/api/browsingdata/remove/index.html')
-rw-r--r-- | files/fr/mozilla/add-ons/webextensions/api/browsingdata/remove/index.html | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/files/fr/mozilla/add-ons/webextensions/api/browsingdata/remove/index.html b/files/fr/mozilla/add-ons/webextensions/api/browsingdata/remove/index.html index 54273fd8b1..304ad17451 100644 --- a/files/fr/mozilla/add-ons/webextensions/api/browsingdata/remove/index.html +++ b/files/fr/mozilla/add-ons/webextensions/api/browsingdata/remove/index.html @@ -25,7 +25,7 @@ translation_of: Mozilla/Add-ons/WebExtensions/API/browsingData/remove <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox brush:js">var removing = browser.browsingData.remove( +<pre class="brush: js">var removing = browser.browsingData.remove( removalOptions, // RemovalOptions object dataTypes // DataTypeSet object ) @@ -74,21 +74,21 @@ then(onRemoved, onError); <p>Supprimer tout l'historique de téléchargement et de navigation :</p> -<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">remove</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>downloads<span class="punctuation token">:</span> <span class="keyword token">true</span><span class="punctuation token">,</span> history<span class="punctuation token">:</span> <span class="keyword token">true</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.remove({}, + {downloads: true, history: true}). +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> |