aboutsummaryrefslogtreecommitdiff
path: root/files/fr/mozilla/add-ons/webextensions/api/browsingdata/removehistory/index.html
diff options
context:
space:
mode:
authorSphinxKnight <SphinxKnight@users.noreply.github.com>2021-11-15 19:39:07 +0100
committerGitHub <noreply@github.com>2021-11-15 19:39:07 +0100
commit34d315396ca29d7ef51ecc27eeeeeb275e9b0ba9 (patch)
tree21f671201b06ff6b0e507de867950b71fe1fddaf /files/fr/mozilla/add-ons/webextensions/api/browsingdata/removehistory/index.html
parent3886d96643d8b7cc626f1dda0e11981ac85def86 (diff)
downloadtranslated-content-34d315396ca29d7ef51ecc27eeeeeb275e9b0ba9.tar.gz
translated-content-34d315396ca29d7ef51ecc27eeeeeb275e9b0ba9.tar.bz2
translated-content-34d315396ca29d7ef51ecc27eeeeeb275e9b0ba9.zip
Prepare Mozilla section for Markdown conversion (#2980)
* Remove summary * Remove hidden except for copyright notice * Remove spans * Remove font * Remove notranslate * Remove extra id, deleting an untranslated page doing so * Fix links, absolute links, rm internal, titles * Remove external classes * fix headings with name attr * fix some styles and classes * remove useless class reference-values * rm styles in links * Fix code blocks in pre * Remove ltr classes * remove fullwidth-table * Fix various conversion errors and some one offs * Remove nested code/pre/code * Fix notes * Fix warnings * fix dls * fix nested issues in dls * fix images
Diffstat (limited to 'files/fr/mozilla/add-ons/webextensions/api/browsingdata/removehistory/index.html')
-rw-r--r--files/fr/mozilla/add-ons/webextensions/api/browsingdata/removehistory/index.html46
1 files changed, 23 insertions, 23 deletions
diff --git a/files/fr/mozilla/add-ons/webextensions/api/browsingdata/removehistory/index.html b/files/fr/mozilla/add-ons/webextensions/api/browsingdata/removehistory/index.html
index 189bd5ed5a..5c8e2bd1b3 100644
--- a/files/fr/mozilla/add-ons/webextensions/api/browsingdata/removehistory/index.html
+++ b/files/fr/mozilla/add-ons/webextensions/api/browsingdata/removehistory/index.html
@@ -27,7 +27,7 @@ translation_of: Mozilla/Add-ons/WebExtensions/API/browsingData/removeHistory
<h2 id="Syntaxe">Syntaxe</h2>
-<pre class="syntaxbox brush:js">var removing = browser.browsingData.removeHistory(
+<pre class="brush: js">var removing = browser.browsingData.removeHistory(
removalOptions // RemovalOptions object
)
</pre>
@@ -51,40 +51,40 @@ translation_of: Mozilla/Add-ons/WebExtensions/API/browsingData/removeHistory
<p>Supprimer les enregistrements de la page visitées de la semaine dernière :</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);
+}
-<span class="keyword token">function</span> <span class="function token">weekInMilliseconds</span><span class="punctuation token">(</span><span class="punctuation token">)</span> <span class="punctuation token">{</span>
- <span class="keyword token">return</span> <span class="number token">1000</span> <span class="operator token">*</span> <span class="number token">60</span> <span class="operator token">*</span> <span class="number token">60</span> <span class="operator token">*</span> <span class="number token">24</span> <span class="operator token">*</span> <span class="number token">7</span><span class="punctuation token">;</span>
-<span class="punctuation token">}</span>
+function weekInMilliseconds() {
+ return 1000 * 60 * 60 * 24 * 7;
+}
-<span class="keyword token">var</span> oneWeekAgo <span class="operator token">=</span> <span class="punctuation token">(</span><span class="keyword token">new</span> <span class="class-name token">Date</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">getTime</span><span class="punctuation token">(</span><span class="punctuation token">)</span> <span class="operator token">-</span> <span class="function token">weekInMilliseconds</span><span class="punctuation token">(</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+var oneWeekAgo = (new Date()).getTime() - weekInMilliseconds();
-browser<span class="punctuation token">.</span>browsingData<span class="punctuation token">.</span><span class="function token">removeHistory</span><span class="punctuation token">(</span>
- <span class="punctuation token">{</span>since<span class="punctuation token">:</span> oneWeekAgo<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.removeHistory(
+ {since: oneWeekAgo}).
+then(onRemoved, onError);</pre>
<p>Supprimer tous les enregistrements des pages visitées :</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">removeHistory</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.removeHistory({}).
+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>