aboutsummaryrefslogtreecommitdiff
path: root/files/fr/mozilla/add-ons/webextensions/api/commands/reset/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/fr/mozilla/add-ons/webextensions/api/commands/reset/index.html')
-rw-r--r--files/fr/mozilla/add-ons/webextensions/api/commands/reset/index.html59
1 files changed, 59 insertions, 0 deletions
diff --git a/files/fr/mozilla/add-ons/webextensions/api/commands/reset/index.html b/files/fr/mozilla/add-ons/webextensions/api/commands/reset/index.html
new file mode 100644
index 0000000000..136a24cc18
--- /dev/null
+++ b/files/fr/mozilla/add-ons/webextensions/api/commands/reset/index.html
@@ -0,0 +1,59 @@
+---
+title: commands.reset()
+slug: Mozilla/Add-ons/WebExtensions/API/commands/reset
+tags:
+ - API
+ - Add-ons
+ - Extensions
+ - Method
+ - Reference
+ - WebExtensions
+ - commands
+ - reset
+translation_of: Mozilla/Add-ons/WebExtensions/API/commands/reset
+---
+<div>{{AddonSidebar()}}</div>
+
+<p>Réinitialise la description de la commande donnée et le raccourci clavier aux valeurs indiquées dans <a href="/fr/Add-ons/WebExtensions/manifest.json/commands"><code>commands</code> de la clé du manifest.json</a> de l'extension.</p>
+
+<p>Cela annule efficacement les modifications apportées à la commande à l'aide de la fonction {{WEbExtAPIRef("commands.update()")}}.</p>
+
+<p>C'est une fonction asynchrone qui renvoie une <code><a href="/fr/docs/Web/JavaScript/Reference/Objets_globaux/Promise">Promise</a></code>.</p>
+
+<h2 id="Syntaxe">Syntaxe</h2>
+
+<pre class="syntaxbox brush:js">browser.commands.reset(
+ name // string
+);
+</pre>
+
+<h3 id="Paramètres">Paramètres</h3>
+
+<dl>
+ <dt><code>name</code></dt>
+ <dd><code>string</code>. Nom de la commande à réinitialiser, comme indiqué par la propriété <code>name</code> de l'objet {{WebExtAPIRef("commands.Command")}}.</dd>
+</dl>
+
+<h3 id="Valeur_retournée">Valeur retournée</h3>
+
+<p>Une <code><a href="/fr/docs/Web/JavaScript/Reference/Objets_globaux/Promise">Promise</a></code> qui sera remplie sans arguments lorsque le raccourci a été réinitialisé.</p>
+
+<h2 id="Compatibilité_du_navigateur">Compatibilité du navigateur</h2>
+
+<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
+
+<p>{{Compat("webextensions.api.commands.reset")}}</p>
+
+<h2 id="Exemples">Exemples</h2>
+
+<p>Réinitialise la commande "my-command" lorsque l'utilisateur clique sur le bouton "reset" :</p>
+
+<pre class="brush: js">const commandName = 'my-command';
+
+function resetShortcut() {
+ browser.commands.reset(commandName);
+}
+
+document.querySelector('#reset').addEventListener('click', resetShortcut);</pre>
+
+<p>{{WebExtExamples}}</p>