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/management | |
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/management')
15 files changed, 1585 insertions, 0 deletions
diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/extensioninfo/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/extensioninfo/index.html new file mode 100644 index 0000000000..4f58fb50c7 --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/extensioninfo/index.html @@ -0,0 +1,128 @@ +--- +title: ExtensionInfo +slug: Mozilla/Add-ons/WebExtensions/API/management/ExtensionInfo +tags: + - API + - Add-ons + - ExtensionInfo + - Extensions + - Reference + - Type + - WebExtensions + - management +translation_of: Mozilla/Add-ons/WebExtensions/API/management/ExtensionInfo +--- +<div>{{AddonSidebar()}}</div> + +<p>Un objet <code>ExtensionInfo</code> contenant les informations sur l'extension.</p> + +<h2 id="Type">Type</h2> + +<p>Il s'agit d'un objet avec les propriétés suivantes :</p> + +<dl class="reference-values"> + <dt><code>description</code></dt> + <dd><code>string</code>. La description de l'extension, prise à partir de la clé de <a href="/fr/Add-ons/WebExtensions/manifest.json/description">description</a> du manifest.json.</dd> + <dt><code>disabledReason</code></dt> + <dd><code>string</code>. Si l'extension est désactivée, la raison pour laquelle il a été désactivé. L'une des "inconnnues' or "permissions_increase".</dd> + <dt><code>enabled</code></dt> + <dd><code>boolean</code>. Que l'extension soit activée ou pas.</dd> + <dt><code>homepageUrl</code></dt> + <dd><code>string</code>. L'URL de la page d'accueil de l'extension, prise en compte de la clé <a href="/fr/Add-ons/WebExtensions/manifest.json/homepage_url">homepage_url</a> du fichier manifest.json.</dd> + <dt><code>hostPermissions</code></dt> + <dd><code>ensemble</code> de <code>chaîne</code>. Les <a href="/fr/Add-ons/WebExtensions/manifest.json/permissions#Host_permissions">permissions d'hôtes</a> de l'extension.</dd> + <dt><code>icons</code></dt> + <dd><code>array</code> of <code>object</code>. les informations sur les icônes des extensions. Un tableau d'objets, un par chaque icône. Chaque objet contient deux propriétés : + <ul> + <li><code>size</code>: un entier représentant la largeur et la hauteur de l'icônes en pixels.</li> + <li><code>url</code>: une chaîne contenant l'url relative de l'icône, en commençant par la racine de l'extensions.</li> + </ul> + </dd> + <dt><code>id</code></dt> + <dd><code>string</code>. l'ID de l'extension.</dd> + <dt><code>installType</code></dt> + <dd><code>string</code>. Une chaîne décriantn comme l'extension a été ajouté. Une des options suivantes : + <ul> + <li>"admin": l'extension a été installé en raison d'une politique administrative.</li> + <li>"development": l'extension a été installé décompressé sur le disque.</li> + <li>"normal": l'extension a été installé normalement à partir du package d'installation.</li> + <li>"sideload": l'extension a été installé par un autre logiciel sur l'ordinateur de l'utilisateur.</li> + <li>"other": l'extension a été installé d'une autre manière.</li> + </ul> + </dd> + <dt><code>mayDisable</code></dt> + <dd><code>boolean</code>. Que cette extensions a été désactivé ou désinstallé par l'utilisateur.</dd> + <dt><code>name</code></dt> + <dd><code>string</code>. Le nom de l'extension, pris à partir de la clé <a href="/fr/Add-ons/WebExtensions/manifest.json/name">name</a> du manifest.json.</dd> + <dt><code>offlineEnabled</code></dt> + <dd><code>boolean</code>. Que les demandes de l'extensions soient prises en charge hors connexion.</dd> + <dt><code>optionsUrl</code></dt> + <dd><code>string</code>. l'URL pour la <a href="/fr/docs/Mozilla/Add-ons/WebExtensions/user_interface/Options_pages">page d'options</a> de l'élément, s'il y en a un. Il s'agit d'une URL relative, à partir de la racine de l'extension.</dd> + <dt><code>permissions</code></dt> + <dd><code>array</code> of <code>string</code>. les <a href="/fr/Add-ons/WebExtensions/manifest.json/permissions#API_permissions">permissions de l'API</a> de l'extension.</dd> + <dt><code>shortName</code></dt> + <dd><code>string</code>. Une courte version du nom de l'extension, prise à partir de la clé <a href="/fr/Add-ons/WebExtensions/manifest.json/short_name">short_name</a> du manifest.json.</dd> + <dt><code>type</code></dt> + <dd><code>string</code>. Chaîne décrivant le type d'extension. Ceci permet de distinguer les extensions des applications et des thèmes. Il peut prendre l'une des valeurs suivantes :</dd> + <dd> + <ul> + <li>"extension": le type d'extension la plus courante.</li> + <li>"hosted_app"</li> + <li>"packaged_app"</li> + <li>"legacy_packaged_app"</li> + <li>"theme"</li> + </ul> + </dd> + <dt><code>updateUrl</code></dt> + <dd><code>string</code>. URL pour la mise à jour de l'extension, tiré de la clé <a href="/fr/Add-ons/WebExtensions/manifest.json/applications">applications</a> de manifest.json.</dd> + <dt><code>version</code></dt> + <dd><code>string</code>. La version de l'extension, tiré de la clé <a href="/fr/Add-ons/WebExtensions/manifest.json/version">version</a> du manifest.json</dd> + <dt><code>versionName</code></dt> + <dd><code>string</code>. Le nom descriptif pour la version de l'extension, tiré de la clé <a href="/fr/Add-ons/WebExtensions/manifest.json/version_name">version_name</a> du manifest.json.</dd> +</dl> + +<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.management.ExtensionInfo")}}</p> + +<p>{{WebExtExamples}}</p> + +<div class="note"><strong>Remerciements :</strong> + +<p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/management"><code>chrome.management</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/management.json"><code>management.json</code></a> dans le code de Chromium code.</p> + +<p>Les données de compatibilité relatives à Microsoft Edge sont fournies par Microsoft Corporation et incluses ici sous la licence Creative Commons Attribution 3.0 pour les États-Unis.</p> +</div> + +<div class="hidden"> +<pre>// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +</pre> +</div> diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/get/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/get/index.html new file mode 100644 index 0000000000..b345415a15 --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/get/index.html @@ -0,0 +1,98 @@ +--- +title: management.get() +slug: Mozilla/Add-ons/WebExtensions/API/management/get +tags: + - API + - Add-ons + - Méthode + - Reference + - WebExtensions + - get + - management +translation_of: Mozilla/Add-ons/WebExtensions/API/management/get +--- +<div>{{AddonSidebar()}}</div> + +<p>Récupère un objet {{WebExtAPIRef("management.ExtensionInfo", "ExtensionInfo")}} contenant des informations sur l'extension spécifiée.</p> + +<p>Cette API requière la <a href="/fr/Add-ons/WebExtensions/manifest.json/permissions">permission API</a> "management"</p> + +<p>Il s'agit d'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">var gettingInfo = browser.management.get( + id // string +) +</pre> + +<h3 id="Paramètres">Paramètres</h3> + +<dl> + <dt><code>id</code></dt> + <dd><code>string</code>. l'ID de l'extension dont vous souhaitez récupérer les informations.</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 avec un objet {{WebExtAPIRef("management.ExtensionInfo", "ExtensionInfo")}} , contenant les informations sur l'extension. La promise sera rejetée si aucune extension avec l'ID donné n'est installée ou si l'appelant ne peut pas accéder à l'extension.</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.management.get")}}</p> + +<h2 id="Exemples">Exemples</h2> + +<p>Enregistrez le nom de l'extension dont l'ID est "my-add-on":</p> + +<pre class="brush: js">var id = "my-add-on"; + +function got(info) { + console.log(info.name); +} + +var getting = browser.management.get(id); +getting.then(got); +</pre> + +<p>{{WebExtExamples}}</p> + +<div class="note"><strong>Remerciements :</strong> + +<p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/management"><code>chrome.management</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/management.json"><code>management.json</code></a> dans le code de Chromium code.</p> + +<p>Les données de compatibilité relatives à Microsoft Edge sont fournies par Microsoft Corporation et incluses ici sous la licence Creative Commons Attribution 3.0 pour les États-Unis.</p> +</div> + +<div class="hidden"> +<pre>// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +</pre> +</div> diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/getall/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/getall/index.html new file mode 100644 index 0000000000..c8a6ceb193 --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/getall/index.html @@ -0,0 +1,96 @@ +--- +title: management.getAll() +slug: Mozilla/Add-ons/WebExtensions/API/management/getAll +tags: + - API + - Add-ons + - Méthode + - Reference + - WebExtensions + - getAll + - management +translation_of: Mozilla/Add-ons/WebExtensions/API/management/getAll +--- +<div>{{AddonSidebar()}}</div> + +<p>Récupère un ensemble d'objets {{WebExtAPIRef("management.ExtensionInfo", "ExtensionInfo")}}, un pour chaque extension installé.</p> + +<p>Notez que Google Chrome récupère les applications ainsi que les modules complémentaires. Dans Chrome vous pouvez distinguer les applications des extensions en utilisant la propriété <code>type</code> de {{WebExtAPIRef("management.ExtensionInfo", "ExtensionInfo")}}.</p> + +<p>Cette API requiert la <a href="/fr/Add-ons/WebExtensions/manifest.json/permissions">permission de l'API</a> de "management"</p> + +<p>Il s'agit d'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">var gettingAll = browser.management.getAll() +</pre> + +<h3 id="Paramètres">Paramètres</h3> + +<p>None.</p> + +<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 rempli avec un ensemble d'objets {{WebExtAPIRef("management.ExtensionInfo", "ExtensionInfo")}}, un pour chaque extension installée.</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.management.getAll")}}</p> + +<h2 id="Exemples">Exemples</h2> + +<p>Enregistrez le nom de toutes les extensions installées :</p> + +<pre class="brush: js">function gotAll(infoArray) { + for (info of infoArray) { + if (info.type == "extension") { + console.log(info.name); + } + } +} + +var gettingAll = browser.management.getAll(); +gettingAll.then(gotAll);</pre> + +<p>{{WebExtExamples}}</p> + +<div class="note"><strong>Remerciements :</strong> + +<p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/management"><code>chrome.management</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/management.json"><code>management.json</code></a> dans le code de Chromium code.</p> + +<p>Les données de compatibilité relatives à Microsoft Edge sont fournies par Microsoft Corporation et incluses ici sous la licence Creative Commons Attribution 3.0 pour les États-Unis.</p> +</div> + +<div class="hidden"> +<pre>// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +</pre> +</div> diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/getpermissionwarningsbyid/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/getpermissionwarningsbyid/index.html new file mode 100644 index 0000000000..c3531b3141 --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/getpermissionwarningsbyid/index.html @@ -0,0 +1,103 @@ +--- +title: management.getPermissionWarningsById() +slug: Mozilla/Add-ons/WebExtensions/API/management/getPermissionWarningsById +tags: + - API + - Add-ons + - Méthode + - Reference + - WebExtensions + - getPermissionWarningsById + - management +translation_of: Mozilla/Add-ons/WebExtensions/API/management/getPermissionWarningsById +--- +<div>{{AddonSidebar()}}</div> + +<div>Lorsque l'utilisateur installe ou met à jour une extension, le navigateur peut avertir l'utilisateur des <a href="/fr/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permissions</a> particulièrement puissantes que l'extension a demandée. Toutes les permissions ne donnent pas lieu à des alertes et ce comportement n'est pas normalisé dans les navigateurs.</div> + +<div></div> + +<p>Compte tenu de l'ID d'une extension, cette fonction retourne les avertisseurs de permissions comme un tableau de chaînes.</p> + +<p>Cette API requière l'<a href="/fr/Add-ons/WebExtensions/manifest.json/permissions">API permission</a> "management"</p> + +<p>Il s'agit d'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">var gettingWarnings = browser.management.getPermissionWarningsById( + id // string +) +</pre> + +<h3 id="Paramètres">Paramètres</h3> + +<dl> + <dt><code>id</code></dt> + <dd><code>string</code>. ID de l'extension dont vous souhaitez récupérer les avertisseurs de permissions.</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 avec un ensemble de chaînes, chacune contenant un texte d'un avertissement de permissions.</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.management.getPermissionWarningsById")}}</p> + +<h2 id="Exemples">Exemples</h2> + +<p>Enregistrez les avertissements de permissions pour l'extension dont l'ID est "my-add-on" :</p> + +<pre class="brush: js">var id = "my-add-on"; + +function gotWarnings(warnings) { + for (warning of warnings) { + console.log(warning); + } +} + +var gettingWarnings = browser.management.getPermissionWarningsById(id); +gettingWarnings.then(gotWarnings);</pre> + +<p>{{WebExtExamples}}</p> + +<div class="note"><strong>Remerciements :</strong> + +<p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/management"><code>chrome.management</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/management.json"><code>management.json</code></a> dans le code de Chromium code.</p> + +<p>Les données de compatibilité relatives à Microsoft Edge sont fournies par Microsoft Corporation et incluses ici sous la licence Creative Commons Attribution 3.0 pour les États-Unis.</p> + +<div class="hidden"> +<pre>// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +</pre> +</div> +</div> diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/getpermissionwarningsbymanifest/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/getpermissionwarningsbymanifest/index.html new file mode 100644 index 0000000000..1835063905 --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/getpermissionwarningsbymanifest/index.html @@ -0,0 +1,112 @@ +--- +title: management.getPermissionWarningsByManifest() +slug: Mozilla/Add-ons/WebExtensions/API/management/getPermissionWarningsByManifest +tags: + - API + - Add-ons + - Méthode + - Reference + - WebExtensions + - getPermissionWarningsByManifest + - management +translation_of: Mozilla/Add-ons/WebExtensions/API/management/getPermissionWarningsByManifest +--- +<div>{{AddonSidebar()}}</div> + +<div>Lorsque l'utilisateur installe ou met à jour une extension, la navigateur peut avertir l'utilisateur des <a href="/fr/Add-ons/WebExtensions/manifest.json/permissions">permissions</a> obligatoires. Toutes les permissions ne donnent pas lieu à des avertissements, et cela n'est pas normalisé dans les navigateurs.</div> + +<div></div> + +<p>Compte tenu du texte du fichier <a href="/fr/Add-ons/WebExtensions/manifest.json">manifest.json</a>, cette fonction retourne les avertisseurs de permissions qui seraient donnés pour l'extension comme un ensemble de chaines.</p> + +<p>Cette API <em>ne requière pas</em> l'<a href="/fr/Add-ons/WebExtensions/manifest.json/permissions">API de permission</a> "management".</p> + +<p>Il s'agit d'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">var gettingWarnings = browser.management.getPermissionWarningsByManifest( + manifestString // string +) +</pre> + +<h3 id="Paramètres">Paramètres</h3> + +<dl> + <dt><code>manifestString</code></dt> + <dd><code>string</code>. Chaîne contenant le fichier manifest. Cela doit être un manifest valide : par exemple, il doit contenir toutes les clés obligatoires du manifest..</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 rempli avec un ensemble de chaînes, chacune contenant le texte un avertisseur de permission.</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.management.getPermissionWarningsByManifest")}}</p> + +<h2 id="Exemples">Exemples</h2> + +<p>Enregistrez les avertissements de permissions dans le fichier manifest donné :</p> + +<pre class="brush: js">var manifest = { + "manifest_version": 2, + "name": "test", + "version": "1.0", + "permissions": ["management", "<all_urls>"] +} + +var manifestString = JSON.stringify(manifest); + +function gotWarnings(warnings) { + console.log(warnings); +} + +function gotError(error) { + console.log(`Error: ${error}`); +} + +var gettingWarnings = browser.management.getPermissionWarningsByManifest(manifestString); +gettingWarnings.then(gotWarnings, gotError);</pre> + +<p>{{WebExtExamples}}</p> + +<div class="note"><strong>Remerciements :</strong> + +<p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/management"><code>chrome.management</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/management.json"><code>management.json</code></a> dans le code de Chromium code.</p> + +<p>Les données de compatibilité relatives à Microsoft Edge sont fournies par Microsoft Corporation et incluses ici sous la licence Creative Commons Attribution 3.0 pour les États-Unis.</p> +</div> + +<div class="hidden"> +<pre>// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +</pre> +</div> diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/getself/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/getself/index.html new file mode 100644 index 0000000000..09d60bab5f --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/getself/index.html @@ -0,0 +1,90 @@ +--- +title: management.getSelf() +slug: Mozilla/Add-ons/WebExtensions/API/management/getSelf +tags: + - API + - Add-ons + - Méthode + - Reference + - WebExtensions + - getSelf + - management +translation_of: Mozilla/Add-ons/WebExtensions/API/management/getSelf +--- +<div>{{AddonSidebar()}}</div> + +<p>Récupère un objet {{WebExtAPIRef("management.ExtensionInfo", "ExtensionInfo")}} contenant les informations de l'extension appelée.</p> + +<p>Cette API <em>ne requière pas</em> l' <a href="/fr/Add-ons/WebExtensions/manifest.json/permissions">API de permission</a> "management".</p> + +<p>Il s'agit d'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">var gettingSelf = browser.management.getSelf() +</pre> + +<h3 id="Paramètres">Paramètres</h3> + +<p>Aucun.</p> + +<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 avec un objet {{WebExtAPIRef("management.ExtensionInfo", "ExtensionInfo")}}, contenant les informations sur l'extension.</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.management.getSelf")}}</p> + +<h2 id="Exemples">Exemples</h2> + +<p>Enregistrez le nom de l'extension :</p> + +<pre class="brush: js">function gotSelf(info) { + console.log("Add-on name: " + info.name); +} + +var gettingSelf = browser.management.getSelf(); +gettingSelf.then(gotSelf);</pre> + +<p>{{WebExtExamples}}</p> + +<div class="note"><strong>Remerciements :</strong> + +<p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/management"><code>chrome.management</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/management.json"><code>management.json</code></a> dans le code de Chromium code.</p> + +<p>Les données de compatibilité relatives à Microsoft Edge sont fournies par Microsoft Corporation et incluses ici sous la licence Creative Commons Attribution 3.0 pour les États-Unis.</p> +</div> + +<div class="hidden"> +<pre>// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +</pre> +</div> diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/index.html new file mode 100644 index 0000000000..ccf2d2a647 --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/index.html @@ -0,0 +1,112 @@ +--- +title: management +slug: Mozilla/Add-ons/WebExtensions/API/management +tags: + - API + - Add-ons + - Extensions + - Reference + - WebExtensions + - management +translation_of: Mozilla/Add-ons/WebExtensions/API/management +--- +<div>{{AddonSidebar}}</div> + +<p>Obtenez les éléments sur les modules complémentaires installés.</p> + +<p>Avec l'API de <code>gestion</code> vous pouvez :</p> + +<ul> + <li>Obtenir des informations sur les modules complémentaires installés</li> + <li>Activer / Désactiver les modules complémentaires</li> + <li>Désinstaller les modules complémentaires</li> + <li>Découvrez quels sont les alertes des permissions envoyés particulièrement par les modules complémentaires ou les manifest</li> + <li>Obtenir les notifications sur l'ajout des modules complémentaires, désinstallé, activé ou désactivé.</li> +</ul> + +<p>La plupart de ces opérations requièrent les <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/permissions">permissions d'APIs</a> de gestion. Les opérations qui ne fournissent pas d'accès à d'autres modules complémentaires ne nécessitent pas de permissions.</p> + +<h2 id="Types">Types</h2> + +<dl> + <dt>{{WebExtAPIRef("management.ExtensionInfo")}}</dt> + <dd>Un objet contenant des informations sur un module complémentaire installé.</dd> +</dl> + +<h2 id="Fonctions">Fonctions</h2> + +<dl> + <dt>{{WebExtAPIRef("management.getAll()")}}</dt> + <dd>Renvoie des informations sur tous les modules complémentaires installés</dd> + <dt>{{WebExtAPIRef("management.get()")}}</dt> + <dd>Renvoie des informations sur un module complémentaire particulier, compte tenu de son ID.</dd> + <dt>{{WebExtAPIRef("management.getSelf()")}}</dt> + <dd>Renvoie des informations sur l'appel du module complémentaire.</dd> + <dt>{{WebExtAPIRef("management.install()")}}</dt> + <dd>Installe un thème particulier, étant donné son URL à l'adresse <a href="https://addons.mozilla.org">addons.mozilla.org</a>.</dd> + <dt>{{WebExtAPIRef("management.uninstall()")}}</dt> + <dd>Désinstalle un module complémenaire particulier, compte tenu de son ID.</dd> + <dt>{{WebExtAPIRef("management.uninstallSelf()")}}</dt> + <dd>Désinstalle l'appel d'un module complémentaire.</dd> + <dt>{{WebExtAPIRef("management.getPermissionWarningsById()")}}</dt> + <dd>Obtenez l'ensemble des alertes des permissions particulièrement pour un module complémentaire, compte tenu de son ID.</dd> + <dt>{{WebExtAPIRef("management.getPermissionWarningsByManifest()")}}</dt> + <dd>Obtenez l'ensemble des alertes de permission qui seraient affichés pour la chaîne de manifest donnée.</dd> + <dt>{{WebExtAPIRef("management.setEnabled()")}}</dt> + <dd>Activer / désactiver un module complémentaire, compte tenu de son ID.</dd> + <dt> + <h2 id="Evénements">Evénements</h2> + </dt> + <dt>{{WebExtAPIRef("management.onInstalled")}}</dt> + <dd>Action quand un module complémentaire est installé.</dd> + <dt>{{WebExtAPIRef("management.onUninstalled")}}</dt> + <dd>Action quand un module complémentaire est désinstallé.</dd> + <dt>{{WebExtAPIRef("management.onEnabled")}}</dt> + <dd>Action quand un module complémentaire est activé.</dd> + <dt>{{WebExtAPIRef("management.onDisabled")}}</dt> + <dd>Action quand un module complémenaire est désactivé.</dd> +</dl> + +<h2 id="Compatibilité_du_navigateur">Compatibilité du navigateur</h2> + +<p>{{Compat("webextensions.api.management")}}</p> + +<p>{{WebExtExamples("h2")}}</p> + +<div class="note"><strong>Remerciements :</strong> + +<p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/management"><code>chrome.management</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/management.json"><code>management.json</code></a> dans le code de Chromium code.</p> + +<p>Les données de compatibilité relatives à Microsoft Edge sont fournies par Microsoft Corporation et incluses ici sous la licence Creative Commons Attribution 3.0 pour les États-Unis.</p> +</div> + +<div class="hidden"> +<pre>// Copyright 2012 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +</pre> +</div> diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/install/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/install/index.html new file mode 100644 index 0000000000..7d34f8cf48 --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/install/index.html @@ -0,0 +1,85 @@ +--- +title: management.install() +slug: Mozilla/Add-ons/WebExtensions/API/management/install +tags: + - API + - Add-ons + - Méthode + - Reference + - Theme + - WebExtensions + - install + - management +translation_of: Mozilla/Add-ons/WebExtensions/API/management/install +--- +<div>{{AddonSidebar()}}</div> + +<div>Installe et active une extension de thème à partir de l'URL donnée.</div> + +<div></div> + +<p>Cette API nécessite la <a href="/fr/Add-ons/WebExtensions/manifest.json/permissions">permission de l'API</a> "management" et ne fonctionnera qu'avec des thèmes signés.</p> + +<p>C'est une fonction asynchrone qui renvoie une <a href="/fr/docs/Web/JavaScript/Reference/Objets_globaux/Promise">Promise</a>.</p> + +<h2 id="Syntaxe">Syntaxe</h2> + +<pre class="syntaxbox brush:js">let {id} = await browser.management.install({url}); +</pre> + +<h3 id="Paramètres">Paramètres</h3> + +<dl> + <dt>options</dt> + <dd>Un objet qui inclut l'URL du fichier XPI du thème à <a href="https://addons.mozilla.org">addons.mozilla.org</a> et un hachage facultatif du fichier XPI, en utilisant sha256 ou plus.</dd> +</dl> + +<h3 id="Valeur_retournée">Valeur retournée</h3> + +<p>Une <a href="/fr/docs/Web/JavaScript/Reference/Objets_globaux/Promise">Promise</a> qui sera remplie avec un objet, contenant l'<code>ExtensionID</code> défini pour le thème dans manifest.json.</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.management.install")}}</p> + +<h2 id="Exemples">Exemples</h2> + +<p>Parcourez une liste de thèmes :</p> + +<pre class="brush: js">"use strict"; + +let themes = [ + "https://addons.mozilla.org/firefox/downloads/file/1063216/insightscare-1.0-fx.xpi", + "https://addons.mozilla.org/firefox/downloads/file/1063419/orange_roses-1.0-fx.xpi", + "https://addons.mozilla.org/firefox/downloads/file/1062647/sticktoyourguns-2.0-fx.xpi", + "https://addons.mozilla.org/firefox/downloads/file/0/bad_url.xpi", +]; + +let current; + +async function install(url) { + try { + current = url; + let {id} = await browser.management.install({url}); + console.log("Theme installed: " + id); + } catch (e) { + console.error("Installation failed: " + e); + } +} + +browser.browserAction.onClicked.addListener(() => { + let id = themes.indexOf(current); + install(themes[(id + 1) % themes.length]); +}); + +for (let url of themes) { + browser.menus.create({ + title: url, + onclick: () => install(url), + contexts: ["browser_action"], + }); +}</pre> + +<p>{{WebExtExamples}}</p> diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/ondisabled/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/ondisabled/index.html new file mode 100644 index 0000000000..14d78eb5e0 --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/ondisabled/index.html @@ -0,0 +1,106 @@ +--- +title: management.onDisabled() +slug: Mozilla/Add-ons/WebExtensions/API/management/onDisabled +tags: + - API + - Add-ons + - Event + - Reference + - WebExtensions + - management + - onDisabled +translation_of: Mozilla/Add-ons/WebExtensions/API/management/onDisabled +--- +<div>{{AddonSidebar()}}</div> + +<p>Action quand l'extension est désactivée.</p> + +<p>L'API requière l'<a href="/en-US/Add-ons/WebExtensions/manifest.json/permissions">API de permission</a> "management".</p> + +<h2 id="Syntaxe">Syntaxe</h2> + +<pre class="syntaxbox brush:js">browser.management.onDisabled.addListener(listener) +browser.management.onDisabled.removeListener(listener) +browser.management.onDisabled.hasListener(listener) +</pre> + +<p>Les événement ont trois fonctions :</p> + +<dl> + <dt><code>addListener(callback)</code></dt> + <dd>Ajoutez un auditeur à cet événement.</dd> + <dt><code>removeListener(listener)</code></dt> + <dd>L'argument de l'auditeur est l'auditeur à supprimer.</dd> + <dt><code>hasListener(listener)</code></dt> + <dd>Vérifie si l'auditeur est enregistré à l'événement. Renvoie <code>true</code> s'il est à l'écoute, sinon <code>false</code> .</dd> +</dl> + +<h2 id="addListener_syntaxe">addListener syntaxe</h2> + +<h3 id="Paramètres">Paramètres</h3> + +<dl> + <dt><code>function</code></dt> + <dd> + <p>Fonction de rappel qui sera appelée lorsque cet événement se produira. La fonction passera par l'argument suivant :</p> + + <dl class="reference-values"> + <dt><code>info</code></dt> + <dd><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/management/ExtensionInfo">ExtensionInfo</a></code>: informations de l'extension qui a été désactivé</dd> + </dl> + </dd> +</dl> + +<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.management.onDisabled")}}</p> + +<h2 id="Exemples">Exemples</h2> + +<p>Enregistrez les noms des extensions lorsqu'ils sont désactivés.</p> + +<pre class="brush: js">browser.management.onDisabled.addListener((info) => { + console.log(info.name + " was disabled"); +});</pre> + +<p>{{WebExtExamples}}</p> + +<div class="note"><strong>Remerciements :</strong> + +<p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/management"><code>chrome.management</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/management.json"><code>management.json</code></a> dans le code de Chromium code.</p> + +<p>Les données de compatibilité relatives à Microsoft Edge sont fournies par Microsoft Corporation et incluses ici sous la licence Creative Commons Attribution 3.0 pour les États-Unis.</p> +</div> + +<div class="hidden"> +<pre>// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +</pre> +</div> diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/onenabled/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/onenabled/index.html new file mode 100644 index 0000000000..51cc3883cb --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/onenabled/index.html @@ -0,0 +1,106 @@ +--- +title: management.onEnabled() +slug: Mozilla/Add-ons/WebExtensions/API/management/onEnabled +tags: + - API + - Add-ons + - Event + - Reference + - WebExtensions + - management + - onEnabled +translation_of: Mozilla/Add-ons/WebExtensions/API/management/onEnabled +--- +<div>{{AddonSidebar()}}</div> + +<p>L'auditeur de l'événement appelé lorsque l'événement <span class="seoSummary"><code>enabled</code> </span>est déclenché, indiquant qu'un add-on est maintenant activé<span class="seoSummary">.</span></p> + +<p>L'API requière l'<a href="/fr/Add-ons/WebExtensions/manifest.json/permissions">API de permission </a>"management"</p> + +<h2 id="Syntaxe">Syntaxe</h2> + +<pre class="syntaxbox brush:js">browser.management.onEnabled.addListener(listener) +browser.management.onEnabled.removeListener(listener) +browser.management.onEnabled.hasListener(listener) +</pre> + +<p>Les événements ont trois fonctions :</p> + +<dl> + <dt><code>addListener(callback)</code></dt> + <dd>Ajoutez un auditeur à cet événement.</dd> + <dt><code>removeListener(listener)</code></dt> + <dd>L'argument de l'auditeur est l'auditeur à supprimer.</dd> + <dt><code>hasListener(listener)</code></dt> + <dd>Vérifie si l'auditeur est enregistré à l'événement. Renvoie <code>true</code> s'il est à l'écoute, sinon <code>false</code> .</dd> +</dl> + +<h2 id="addListener_syntaxe">addListener syntaxe</h2> + +<h3 id="Parameters">Parameters</h3> + +<dl> + <dt><code>function</code></dt> + <dd> + <p>Fonction de rappel qui sera appelée lorsque cet événement se produira. La fonction passera par l'argument suivant :</p> + + <dl class="reference-values"> + <dt><code>info</code></dt> + <dd><code><a href="/fr/Add-ons/WebExtensions/API/management/ExtensionInfo">ExtensionInfo</a></code>: informations de l'extension qui a été désinstallé.</dd> + </dl> + </dd> +</dl> + +<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.management.onEnabled")}}</p> + +<h2 id="Exemples">Exemples</h2> + +<p>Enregistrez les noms des extensions lorsqu'ils sont activés :</p> + +<pre class="brush: js">browser.management.onEnabled.addListener((info) => { + console.log(info.name + " was enabled"); +});</pre> + +<p>{{WebExtExamples}}</p> + +<div class="note"><strong>Remerciements :</strong> + +<p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/management"><code>chrome.management</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/management.json"><code>management.json</code></a> dans le code de Chromium code.</p> + +<p>Les données de compatibilité relatives à Microsoft Edge sont fournies par Microsoft Corporation et incluses ici sous la licence Creative Commons Attribution 3.0 pour les États-Unis.</p> +</div> + +<div class="hidden"> +<pre>// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +</pre> +</div> diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/oninstalled/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/oninstalled/index.html new file mode 100644 index 0000000000..4133c0101a --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/oninstalled/index.html @@ -0,0 +1,106 @@ +--- +title: management.onInstalled() +slug: Mozilla/Add-ons/WebExtensions/API/management/onInstalled +tags: + - API + - Add-ons + - Event + - Reference + - WebExtensions + - management + - onInstalled +translation_of: Mozilla/Add-ons/WebExtensions/API/management/onInstalled +--- +<div>{{AddonSidebar()}}</div> + +<p>Action quand une extension est installée.</p> + +<p>Cette API requière l'<a href="/fr/Add-ons/WebExtensions/manifest.json/permissions">API de permission </a>"management".</p> + +<h2 id="Syntaxe">Syntaxe</h2> + +<pre class="syntaxbox brush:js">browser.management.onInstalled.addListener(listener) +browser.management.onInstalled.removeListener(listener) +browser.management.onInstalled.hasListener(listener) +</pre> + +<p>Les événements ont trois fonctions :</p> + +<dl> + <dt><code>addListener(callback)</code></dt> + <dd>Ajout un auditeur à l'événement.</dd> + <dt><code>removeListener(listener)</code></dt> + <dd>Arrêtez d'écouvter l'événement. L'argument de l'auditeur est un auditeur à supprimer.</dd> + <dt><code>hasListener(listener)</code></dt> + <dd>Vérifie si un auditeur est enregistré pour cet événement. Renvoie <code>vrai</code> si elle est à l'écoute, sinon <code>faux</code> .</dd> +</dl> + +<h2 id="addListener_syntaxe">addListener syntaxe</h2> + +<h3 id="Paramètres">Paramètres</h3> + +<dl> + <dt><code>function</code></dt> + <dd> + <p>fonction de rappel qui sera appelée quand l'événement se produira. La fonction passera l'argument suivant :</p> + + <dl class="reference-values"> + <dt><code>info</code></dt> + <dd><code><a href="/fr/Add-ons/WebExtensions/API/management/ExtensionInfo">ExtensionInfo</a></code>: informations sur l'extension qui a été installée.</dd> + </dl> + </dd> +</dl> + +<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.management.onInstalled")}}</p> + +<h2 id="Exemples">Exemples</h2> + +<p>Enregistrez les noms des extensions lorsqu'ils sont installés :</p> + +<pre class="brush: js">browser.management.onInstalled.addListener((info) => { + console.log(info.name + " was installed"); +});</pre> + +<p>{{WebExtExamples}}</p> + +<div class="note"><strong>Remerciements :</strong> + +<p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/management"><code>chrome.management</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/management.json"><code>management.json</code></a> dans le code de Chromium code.</p> + +<p>Les données de compatibilité relatives à Microsoft Edge sont fournies par Microsoft Corporation et incluses ici sous la licence Creative Commons Attribution 3.0 pour les États-Unis.</p> + +<div class="hidden"> +<pre>// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +</pre> +</div> +</div> diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/onuninstalled/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/onuninstalled/index.html new file mode 100644 index 0000000000..22323ddd12 --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/onuninstalled/index.html @@ -0,0 +1,106 @@ +--- +title: management.onUninstalled() +slug: Mozilla/Add-ons/WebExtensions/API/management/onUninstalled +tags: + - API + - Add-ons + - Event + - Reference + - WebExtensions + - management + - onUninstalled +translation_of: Mozilla/Add-ons/WebExtensions/API/management/onUninstalled +--- +<div>{{AddonSidebar()}}</div> + +<p>Action quand une extension est désinstallée.</p> + +<p>L'API requière l'<a href="/fr/Add-ons/WebExtensions/manifest.json/permissions">API de permission </a>"management".</p> + +<h2 id="Syntaxe">Syntaxe</h2> + +<pre class="syntaxbox brush:js">browser.management.onUninstalled.addListener(listener) +browser.management.onUninstalled.removeListener(listener) +browser.management.onUninstalled.hasListener(listener) +</pre> + +<p>Les événement ont trois fonctions :</p> + +<dl> + <dt><code>addListener(callback)</code></dt> + <dd>Ajoutez un auditeur à cet événement.</dd> + <dt><code>removeListener(listener)</code></dt> + <dd>L'argument de l'auditeur est l'auditeur à supprimer.</dd> + <dt><code>hasListener(listener)</code></dt> + <dd>Vérifie si l'auditeur est enregistré à l'événement. Renvoie <code>true</code> s'il est à l'écoute, sinon <code>false</code> .</dd> +</dl> + +<h2 id="addListener_syntaxe">addListener syntaxe</h2> + +<h3 id="Paramètres">Paramètres</h3> + +<dl> + <dt><code>function</code></dt> + <dd> + <p>Fonction de rappel qui sera appelée lorsque cet événement se produira. La fonction passera par l'argument suivant :</p> + + <dl class="reference-values"> + <dt><code>info</code></dt> + <dd><code><a href="/fr/Add-ons/WebExtensions/API/management/ExtensionInfo">ExtensionInfo</a></code>: informations de l'extension qui a été désinstallé.</dd> + </dl> + </dd> +</dl> + +<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.management.onUninstalled")}}</p> + +<h2 id="Exemples">Exemples</h2> + +<p>Enregistrez les noms des extensions lorsqu'ils sont désinstallés :</p> + +<pre class="brush: js">browser.management.onUninstalled.addListener((info) => { + console.log(info.name + " was uninstalled"); +});</pre> + +<p>{{WebExtExamples}}</p> + +<div class="note"><strong>Remerciements :</strong> + +<p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/management"><code>chrome.management</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/management.json"><code>management.json</code></a> dans le code de Chromium code.</p> + +<p>Les données de compatibilité relatives à Microsoft Edge sont fournies par Microsoft Corporation et incluses ici sous la licence Creative Commons Attribution 3.0 pour les États-Unis.</p> +</div> + +<div class="hidden"> +<pre>// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +</pre> +</div> diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/setenabled/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/setenabled/index.html new file mode 100644 index 0000000000..b2f074c381 --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/setenabled/index.html @@ -0,0 +1,105 @@ +--- +title: management.setEnabled() +slug: Mozilla/Add-ons/WebExtensions/API/management/setEnabled +tags: + - API + - Add-ons + - Méthode + - Reference + - WebExtensions + - management + - setEnabled +translation_of: Mozilla/Add-ons/WebExtensions/API/management/setEnabled +--- +<div>{{AddonSidebar()}}</div> + +<p>Active ou désactive l'extension ajoutée.</p> + +<p>Cette fonction doit généralement être appelée dans le contexte d'une action utilisateur, comme le gestionnaire de clics d'un bouton. Le navigateur peut également demander à l'utilisateur de confirmer le changement.</p> + +<p>Cette API requière l'<a href="/fr/Add-ons/WebExtensions/manifest.json/permissions">API permission</a> "management".</p> + +<p>Il s'agit d'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">var settingEnabled = browser.management.setEnabled( + id, // string + enabled // boolean +) +</pre> + +<h3 id="Paramètres">Paramètres</h3> + +<dl> + <dt><code>id</code></dt> + <dd><code>string</code>. ID de l'extension pour activer ou désactiver.</dd> + <dt><code>enabled</code></dt> + <dd><code>boolean</code>. Que ce soit pour active ou désactiver l'extension.</dd> +</dl> + +<h3 id="Valeur_retournée">Valeur retournée</h3> + +<p>Une <code><a href="/fr/docs/Web/JavaScript/Reference/Objets_globaux/Promisee">Promise</a></code> qui sera remplie sans arguments lorsque l'extension a été désactivé ou activé.</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.management.setEnabled")}}</p> + +<h2 id="Exemples">Exemples</h2> + +<p>Actviez / Désactivez l'option pour l'extension dont l'ID est "my-add-on":</p> + +<pre class="brush: js">var id = "my-add-on"; + +function toggleEnabled(id) { + var getting = browser.management.get(id); + getting.then((info) => { + browser.management.setEnabled(id, !info.enabled); + }); +} + +toggleEnabled(id); +</pre> + +<p>{{WebExtExamples}}</p> + +<div class="note"><strong>Remerciements :</strong> + +<p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/management"><code>chrome.management</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/management.json"><code>management.json</code></a> dans le code de Chromium code.</p> + +<p>Les données de compatibilité relatives à Microsoft Edge sont fournies par Microsoft Corporation et incluses ici sous la licence Creative Commons Attribution 3.0 pour les États-Unis.</p> +</div> + +<div class="hidden"> +<pre>// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +</pre> +</div> diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/uninstall/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/uninstall/index.html new file mode 100644 index 0000000000..38c6ac84e4 --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/uninstall/index.html @@ -0,0 +1,111 @@ +--- +title: management.uninstall() +slug: Mozilla/Add-ons/WebExtensions/API/management/uninstall +tags: + - API + - Add-ons + - Méthode + - Reference + - WebExtensions + - management + - uninstall +translation_of: Mozilla/Add-ons/WebExtensions/API/management/uninstall +--- +<div>{{AddonSidebar()}}</div> + +<p>Désinstalle une extension, compte tenu de son ID.</p> + +<p>Cette API requiert l'<a href="/fr/Add-ons/WebExtensions/manifest.json/permissions">API de permission</a>. "management"</p> + +<p>Il s'agit d'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">var uninstalling = browser.management.uninstall( + id, // string + options // object +) +</pre> + +<h3 id="Paramètres">Paramètres</h3> + +<dl> + <dt><code>id</code></dt> + <dd><code>string</code>. ID de l'extensions à désinstaller.</dd> + <dt><code>options{{optional_inline}}</code></dt> + <dd><code>object</code>. l'objet qui peut contenir une propriété unique, <code>showConfirmDialog</code>. Si <code>showConfirmDialog</code> est <code>true</code>, le navigateur affiche une boie de dialogue demandant à l'utilisateur de confirmer que le complément doit être désinstallé. + <ul> + <li>Si <code>id</code> est l'ID de l'extension appelant, <code>showConfirmDialog</code> est par défaut à <code>false</code>.</li> + <li>Si <code>id</code> est l'ID d'une extension différente, cette option est ignorée et la boite de dialogue de confirmation s'affche toujours.</li> + </ul> + </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 rejetée avec un message d'erreur si l'utilisateur a annulé la désintallatiion.</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.management.uninstall")}}</p> + + + +<h2 id="Exemples">Exemples</h2> + +<p>Désinstallez l'extension dont l'ID est "my-addon-id", en demandant à l'utilisateur de confirmer. Dans le rappel, vérifiez si l'utilisateur a annué la désinstallation.</p> + +<p>Notez que nous n'avons réussi un gestionnaire d'exécution, car si la désinstallation réussit, l'extension n'est plus disponible pour le gérer.</p> + +<pre class="brush: js">var id = "my-addon-id"; + +function onCanceled(error) { + console.log(`Uninstall canceled: ${error}`); +} + +var uninstalling = browser.management.uninstall(id); +uninstalling.then(null, onCanceled);</pre> + +<p>{{WebExtExamples}}</p> + +<div class="note"><strong>Remerciements :</strong> + +<p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/management"><code>chrome.management</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/management.json"><code>management.json</code></a> dans le code de Chromium code.</p> + +<p>Les données de compatibilité relatives à Microsoft Edge sont fournies par Microsoft Corporation et incluses ici sous la licence Creative Commons Attribution 3.0 pour les États-Unis.</p> +</div> + +<div class="hidden"> +<pre>// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +</pre> +</div> diff --git a/files/fr/mozilla/add-ons/webextensions/api/management/uninstallself/index.html b/files/fr/mozilla/add-ons/webextensions/api/management/uninstallself/index.html new file mode 100644 index 0000000000..9bdfbb763d --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/management/uninstallself/index.html @@ -0,0 +1,121 @@ +--- +title: management.uninstallSelf() +slug: Mozilla/Add-ons/WebExtensions/API/management/uninstallSelf +tags: + - API + - Add-ons + - Méthode + - Reference + - UnintallSeft + - WebExtensions + - management +translation_of: Mozilla/Add-ons/WebExtensions/API/management/uninstallSelf +--- +<div>{{AddonSidebar()}}</div> + +<p>Désinstalle l'appel de l'extension.</p> + +<p>Cette API <em>ne requiert pas</em> la <a href="/fr/Add-ons/WebExtensions/manifest.json/permissions">permission API</a> "management"</p> + +<p>Il s'agit d'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">var uninstallingSelf = browser.management.uninstallSelf( + options // object +) +</pre> + +<h3 id="Paramètres">Paramètres</h3> + +<dl> + <dt><code>options{{optional_inline}}</code></dt> + <dd><code>object</code>. L'objet qui peut comporter deux propriétés, toutes deux facultatives :</dd> + <dd> + <dl class="reference-values"> + <dt><code>showConfirmDialog{{optional_inline}}</code></dt> + <dd>Boolean. Si <code>showConfirmDialog</code> est <code>true</code>, le navigateur affiche la boite de dialogue demandant à l'utilisateur de confirmer que le complément doit être désinstallé. Par défaut à <code>false</code>.</dd> + <dt><code>dialogMessage{{optional_inline}}</code></dt> + <dd>String. Un message supplémentaire qui sera affiché dans la boite de dialogue de confirmation.</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 rejetée avec un message d'erreur si l'utilisateur a annulé la désinstallation.</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.management.uninstallSelf")}}</p> + + <h2 id="Exemples">Exemples</h2> + + <p>Désinsallez l'extension, en demandant à l'utilisateur de confirmer. Dans le rappel, vérifiez si l'utilisateur a annulé la désinstallation.</p> + + <p>Notez que n'avons pas passé un gestionnaire d'éxécution, car si la desinstallation réussit, l'extension n'est plus disponible pour le gérer.</p> + + <pre class="brush: js">function onCanceled(error) { + console.log(`Canceled: ${error}`); +} + +var uninstalling = browser.management.uninstallSelf({ + showConfirmDialog: true +}); + +uninstalling.then(null, onCanceled);</pre> + + <p>Le même, mais aussi l'ajout d'un message personnalisé à la boite de dialogue :</p> + + <pre class="brush: js">function onCanceled(error) { + console.log(`Canceled: ${error}`); +} + +var uninstalling = browser.management.uninstallSelf({ + showConfirmDialog: true, + dialogMessage: "Testing self-uninstall" +}); + +uninstalling.then(null, onCanceled);</pre> + + <p>{{WebExtExamples}}</p> + + <div class="note"><strong>Remerciements :</strong> + + <p>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/management"><code>chrome.management</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/management.json"><code>management.json</code></a> dans le code de Chromium code.</p> + + <p>Les données de compatibilité relatives à Microsoft Edge sont fournies par Microsoft Corporation et incluses ici sous la licence Creative Commons Attribution 3.0 pour les États-Unis.</p> + </div> + + <div class="hidden"> + <pre>// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +</pre> + </div> + </dd> +</dl> |