diff options
author | julieng <julien.gattelier@gmail.com> | 2021-11-15 21:45:15 +0100 |
---|---|---|
committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-11-15 22:10:33 +0100 |
commit | 3cf9bd8b9901006085d4e0f353b0d3b6b8f69d93 (patch) | |
tree | e82ac56afff3bc213cc2971cd8aada25a174eee9 /files/fr/mozilla/add-ons/webextensions/api/runtime/getplatforminfo | |
parent | f36cc6a7639a8f1adff02bc7a152bd7f54ceae6d (diff) | |
download | translated-content-3cf9bd8b9901006085d4e0f353b0d3b6b8f69d93.tar.gz translated-content-3cf9bd8b9901006085d4e0f353b0d3b6b8f69d93.tar.bz2 translated-content-3cf9bd8b9901006085d4e0f353b0d3b6b8f69d93.zip |
convert content to md
Diffstat (limited to 'files/fr/mozilla/add-ons/webextensions/api/runtime/getplatforminfo')
-rw-r--r-- | files/fr/mozilla/add-ons/webextensions/api/runtime/getplatforminfo/index.md | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/files/fr/mozilla/add-ons/webextensions/api/runtime/getplatforminfo/index.md b/files/fr/mozilla/add-ons/webextensions/api/runtime/getplatforminfo/index.md index 1af9d51e7e..f07321263f 100644 --- a/files/fr/mozilla/add-ons/webextensions/api/runtime/getplatforminfo/index.md +++ b/files/fr/mozilla/add-ons/webextensions/api/runtime/getplatforminfo/index.md @@ -13,51 +13,52 @@ tags: - runtime translation_of: Mozilla/Add-ons/WebExtensions/API/runtime/getPlatformInfo --- -<div>{{AddonSidebar()}}</div> +{{AddonSidebar()}} -<p>Renvoies des informations sur la plate-forme actuelle. Ceci ne peut être appelé que dans le contexte du script d'arrière-plan.</p> +Renvoies des informations sur la plate-forme actuelle. Ceci ne peut être appelé que dans le contexte du script d'arrière-plan. -<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> +Il s'agit d'une fonction asynchrone qui renvoie une [`Promise`](/fr/docs/Web/JavaScript/Reference/Objets_globaux/Promise). -<h2 id="Syntaxe">Syntaxe</h2> +## Syntaxe -<pre class="brush: js">var getting = browser.runtime.getPlatformInfo() -</pre> +```js +var getting = browser.runtime.getPlatformInfo() +``` -<h3 id="Paramètres">Paramètres</h3> +### Paramètres -<p>None.</p> +None. -<h3 id="Valeur_rentournée">Valeur rentournée</h3> +### Valeur rentournée -<p>Une <code><a href="/fr/docs/Web/JavaScript/Reference/Objets_globaux/Promise">Promise</a></code> qui sera remplie avec une valeur {{WebExtAPIRef('runtime.PlatformInfo')}} représentant la plate-forme actuelle.</p> +Une [`Promise`](/fr/docs/Web/JavaScript/Reference/Objets_globaux/Promise) qui sera remplie avec une valeur {{WebExtAPIRef('runtime.PlatformInfo')}} représentant la plate-forme actuelle. -<h2 id="Compatibilité_du_navigateur">Compatibilité du navigateur</h2> +## Compatibilité du navigateur -<p>{{Compat("webextensions.api.runtime.getPlatformInfo")}}</p> +{{Compat("webextensions.api.runtime.getPlatformInfo")}} -<h2 id="Exemples">Exemples</h2> +## Exemples -<p>Obtenez et consignez le système d'exploitation de la plateforme :</p> +Obtenez et consignez le système d'exploitation de la plateforme : -<pre class="brush: js">function gotPlatformInfo(info) { +```js +function gotPlatformInfo(info) { console.log(info.os); } var gettingInfo = browser.runtime.getPlatformInfo(); -gettingInfo.then(gotPlatformInfo);</pre> +gettingInfo.then(gotPlatformInfo); +``` -<p>{{WebExtExamples}}</p> +{{WebExtExamples}} -<div class="note"><p><strong>Note :</strong></p> +> **Note :** +> +> Cette API est basée sur l'API Chromium [`chrome.runtime`](https://developer.chrome.com/extensions/runtime#event-onConnect). Cette documentation est dérivée de [`runtime.json`](https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/runtime.json) dans le code de Chromium code. +> +> 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>Cette API est basée sur l'API Chromium <a href="https://developer.chrome.com/extensions/runtime#event-onConnect"><code>chrome.runtime</code></a>. Cette documentation est dérivée de <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/runtime.json"><code>runtime.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. +<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 @@ -84,5 +85,4 @@ gettingInfo.then(gotPlatformInfo);</pre> // 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> +</pre></div> |