diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
| commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
| tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/fr/mozilla/add-ons/webextensions/api/commands/reset/index.html | |
| parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
| download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip | |
initial commit
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.html | 59 |
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> |
