diff options
author | Florian Merz <me@fiji-flo.de> | 2021-02-11 12:36:08 +0100 |
---|---|---|
committer | Florian Merz <me@fiji-flo.de> | 2021-02-11 12:36:08 +0100 |
commit | 39f2114f9797eb51994966c6bb8ff1814c9a4da8 (patch) | |
tree | 66dbd9c921f56e440f8816ed29ac23682a1ac4ef /files/fr/mozilla/add-ons/webextensions/api/devtools/network | |
parent | 8260a606c143e6b55a467edf017a56bdcd6cba7e (diff) | |
download | translated-content-39f2114f9797eb51994966c6bb8ff1814c9a4da8.tar.gz translated-content-39f2114f9797eb51994966c6bb8ff1814c9a4da8.tar.bz2 translated-content-39f2114f9797eb51994966c6bb8ff1814c9a4da8.zip |
unslug fr: move
Diffstat (limited to 'files/fr/mozilla/add-ons/webextensions/api/devtools/network')
4 files changed, 378 insertions, 0 deletions
diff --git a/files/fr/mozilla/add-ons/webextensions/api/devtools/network/gethar/index.html b/files/fr/mozilla/add-ons/webextensions/api/devtools/network/gethar/index.html new file mode 100644 index 0000000000..abcdf667e6 --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/devtools/network/gethar/index.html @@ -0,0 +1,88 @@ +--- +title: devtools.network.getHAR() +slug: Mozilla/Add-ons/WebExtensions/API/devtools.network/getHAR +tags: + - Add-ons + - Extensions + - WebExtensions + - devtools.network + - getHAR +translation_of: Mozilla/Add-ons/WebExtensions/API/devtools.network/getHAR +--- +<div>{{AddonSidebar()}}</div> + +<p>Obtenez un <a href="http://www.softwareishard.com/blog/har-12-spec/#log">journal HAR</a> pour la page chargée dans l'onglet en cours.</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">var getting = browser.devtools.network.getHAR() +</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 remplie avec un objet contenant le journal HAR pour l'onglet en cours. Pour plus de détails sur ce que contient l'objet journal, reportez-vous à la <a href="http://www.softwareishard.com/blog/har-12-spec/#log">spécification HAR</a>.</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.devtools.network.getHAR")}}</p> + +<h2 id="Exemples">Exemples</h2> + +<p>Consignez les URL des demandes contenues dans le journal HAR :</p> + +<pre class="brush: js">async function logRequests() { + let harLog = await browser.devtools.network.getHAR(); + console.log(`HAR version: ${harLog.version}`); + for (let entry of harLog.entries) { + console.log(entry.request.url); + } +} + +logRequestsButton.addEventListener("click", logRequests); +</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/devtools_network"><code>chrome.devtools.network</code></a>.</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/devtools/network/index.html b/files/fr/mozilla/add-ons/webextensions/api/devtools/network/index.html new file mode 100644 index 0000000000..580a823371 --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/devtools/network/index.html @@ -0,0 +1,75 @@ +--- +title: devtools.network +slug: Mozilla/Add-ons/WebExtensions/API/devtools.network +tags: + - API + - Add-ons + - Extensions + - Reference + - WebExtensions + - devtools.network +translation_of: Mozilla/Add-ons/WebExtensions/API/devtools.network +--- +<div>{{AddonSidebar}}</div> + +<p>L'API <code>devtools.network</code> permet à une extension devtools d'obtenir des informations sur les demandes de réseau associées à la fenêtre à laquelle les devtools sont attachés (la fenêtre inspectée).</p> + +<p>Comme toutes les APIs de devtools, cette API est uniquement disponible pour le code exécuté dans le document défini dans la clé <a href="/fr/Add-ons/WebExtensions/manifest.json/devtools_page">devtools_page</a> du manifest.json, ou dans d'autres documents de devtools créés par l'extension (tel que le document du panneau). Voir <a href="/fr/Add-ons/WebExtensions/Extending_the_developer_tools">Extension des outils de développement</a> pour plus d'informations.</p> + +<h2 id="Fonctions">Fonctions</h2> + +<dl> + <dt><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools.network/getHAR">devtools.network.getHAR()</a></dt> + <dd>Obtenez le <a class="external external-icon" href="http://www.softwareishard.com/blog/har-12-spec/#log" rel="noopener">journal HAR</a> pour la page chargée dans l'onglet en cours..</dd> +</dl> + +<h2 id="Evénements">Evénements</h2> + +<dl> + <dt><code><a href="/fr/Add-ons/WebExtensions/API/devtools.network/onNavigated">devtools.network.onNavigated</a></code></dt> + <dd>Attiré lorsque l'utilisateur navigue dans la fenêtre inspectée vers une nouvelle page.</dd> + <dt><code><a href="/fr/Add-ons/WebExtensions/API/devtools.network/onRequestFinished">devtools.network.onRequestFinished</a></code></dt> + <dd>Lancé lorsque la demande réseau est terminée et que ses détails sont disponibles pour l'extension.</dd> +</dl> + +<h2 id="Compatibilité_du_navigateur">Compatibilité du navigateur</h2> + +<p>{{Compat("webextensions.api.devtools.network")}}</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/devtools_network"><code>chrome.devtools.network</code></a>.</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/devtools/network/onnavigated/index.html b/files/fr/mozilla/add-ons/webextensions/api/devtools/network/onnavigated/index.html new file mode 100644 index 0000000000..b7f0d0af31 --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/devtools/network/onnavigated/index.html @@ -0,0 +1,103 @@ +--- +title: devtools.network.onNavigated +slug: Mozilla/Add-ons/WebExtensions/API/devtools.network/onNavigated +tags: + - API + - Add-ons + - Extensions + - Reference + - WebExtensions + - devtools.network +translation_of: Mozilla/Add-ons/WebExtensions/API/devtools.network/onNavigated +--- +<div>{{AddonSidebar()}}</div> + +<p>Mise en place lorsque l'utilisateur navigue dans la fenêtre inspectée vers une nouvelle page</p> + +<h2 id="Syntaxe">Syntaxe</h2> + +<pre class="syntaxbox brush:js">browser.devtools.network.onNavigated.addListener(listener) +browser.devtools.network.onNavigated.removeListener(listener) +browser.devtools.network.onNavigated.hasListener(listener) +</pre> + +<p>Les événements ont trois fonctions :</p> + +<dl> + <dt><code>addListener(listener)</code></dt> + <dd>Ajouter un auditeur à cet événement.</dd> + <dt><code>removeListener(listener)</code></dt> + <dd>Arrêter d'écouter un événement. L'argument de l'auditeur est l'auditeur à supprimer.</dd> + <dt><code>hasListener(listener)</code></dt> + <dd>Vérifiez si l'auditeur est enregistré pour cet événement. Renvoie <strong>vrai</strong> si elle écoute, sinon <strong>faux</strong>.</dd> +</dl> + +<h2 id="Syntaxe_addListener">Syntaxe addListener</h2> + +<h3 id="Paramètres">Paramètres</h3> + +<dl> + <dt><code>callback</code></dt> + <dd> + <p>Fonction qui sera appelée lors de l'événement. La fonction passera les arguments suivants :</p> + + <dl class="reference-values"> + <dt><code>url</code></dt> + <dd><code>string</code>. La nouvelle URL pour la fenêtre.</dd> + </dl> + </dd> +</dl> + +<h2 id="Compatibilité_du_navigateur">Compatibilité du navigateur</h2> + +<p>{{Compat("webextensions.api.devtools.network.onNavigated")}}</p> + +<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> + +<h2 id="Exemples">Exemples</h2> + +<pre class="brush: js">function handleNavigated(url) { + console.log(url); +} + +browser.devtools.network.onNavigated.addListener(handleNavigated);</pre> + +<p>{{WebExtExamples}}</p> + +<div class="note"><strong>Remerciements</strong> + +<p>Cette API est basée sur l'API <a href="https://developer.chrome.com/extensions/devtools"><code>chrome.devtools</code></a> de Chromium.</p> + +<p>Les données de compatibilité de Microsoft Edge sont fournies par Microsoft Corporation et sont incluses ici sous la licence Creative Commons Attribution 3.0 United States.</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/devtools/network/onrequestfinished/index.html b/files/fr/mozilla/add-ons/webextensions/api/devtools/network/onrequestfinished/index.html new file mode 100644 index 0000000000..e2b4d930fc --- /dev/null +++ b/files/fr/mozilla/add-ons/webextensions/api/devtools/network/onrequestfinished/index.html @@ -0,0 +1,112 @@ +--- +title: devtools.network.onRequestFinished +slug: Mozilla/Add-ons/WebExtensions/API/devtools.network/onRequestFinished +tags: + - API + - Add-ons + - Event + - Extensions + - Reference + - WebExtensions + - devtools.network + - onRequestFinished +translation_of: Mozilla/Add-ons/WebExtensions/API/devtools.network/onRequestFinished +--- +<div>{{AddonSidebar()}}</div> + +<p>Lancé lorsqu'une requête réseau est terminée et que ses détails sont disponibles pour l'extension.</p> + +<p>La requête est donnée en tant qu'<a href="http://www.softwareishard.com/blog/har-12-spec/#entries">objet d'entrée HAR</a>, qui est également doté d'une méthode <code>getContent()</code> asynchrone qui récupère le contenu du corps de la réponse.</p> + +<p>Notez que bien que votre extension puisse ajouter un écouteur à tout moment,elle commencera seulement à se déclencher après que l'utilisateur a activé le <a href="/fr/docs/Outils/Moniteur_réseau">moniteur réseau</a> du navigateur au moins une fois.</p> + +<h2 id="Syntaxe">Syntaxe</h2> + +<pre class="syntaxbox brush:js">browser.devtools.network.onRequestFinished.addListener(listener) +browser.devtools.network.onRequestFinished.removeListener(listener) +browser.devtools.network.onRequestFinished.hasListener(listener) +</pre> + +<p>Les événements ont trois fonctions</p> + +<dl> + <dt><code>addListener(listener)</code></dt> + <dd>Ajoute un écouteur à cet événement.</dd> + <dt><code>removeListener(listener)</code></dt> + <dd>Arrêtez d'écouter cet événement. L'argument de <code>listener</code> est l'écouteur à supprimer.</dd> + <dt><code>hasListener(listener)</code></dt> + <dd>Vérifiez si <code>listener</code> est enregistré pour cet événement. Renvoie <code>true</code>s'il écoute, sinon <code>false</code>.</dd> +</dl> + +<h2 id="Syntaxe_addListener">Syntaxe addListener</h2> + +<h3 id="Paramètres">Paramètres</h3> + +<dl> + <dt><code>callback</code></dt> + <dd> + <p>Fonction qui sera appelée lorsque cet événement se produit. La fonction recevra les arguments suivants :</p> + + <dl class="reference-values"> + <dt><code>request</code></dt> + <dd><code>object</code>. Un objet représentant la requête. Cet objet est un seul objet d'<a href="http://www.softwareishard.com/blog/har-12-spec/#entries">entrée HAR</a>. Il définit également une méthode <code>getContent()</code> asynchrone, qui renvoie une <code><a href="/fr/docs/Web/JavaScript/Reference/Objets_globaux/Promise">Promise</a></code> qui se résout avec le corps de la réponse.</dd> + </dl> + </dd> +</dl> + +<h2 id="Compatibilité_du_navigateur">Compatibilité du navigateur</h2> + +<p>{{Compat("webextensions.api.devtools.network.onRequestFinished")}}</p> + +<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> + +<h2 id="Examples">Examples</h2> + +<p>Ajoutez un écouteur qui consigne l'adresse IP du serveur et le corps de la réponse pour chaque requête réseau.</p> + +<pre class="brush: js">function handleRequestFinished(request) { + console.log("Server IP: ", request.serverIPAddress); + request.getContent().then(content => { + console.log("Content: ", content); + }); +} + +browser.devtools.network.onRequestFinished.addListener(handleRequestFinished);</pre> + +<p>{{WebExtExamples}}</p> + +<div class="note"><strong>Remerciements</strong> + +<p>Cette API est basée sur l'API <a href="https://developer.chrome.com/extensions/devtools"><code>chrome.devtools</code></a> de Chromium.</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> |