diff options
Diffstat (limited to 'files/fr/mozilla/add-ons/webextensions/api/pkcs11')
5 files changed, 26 insertions, 26 deletions
diff --git a/files/fr/mozilla/add-ons/webextensions/api/pkcs11/getmoduleslots/index.html b/files/fr/mozilla/add-ons/webextensions/api/pkcs11/getmoduleslots/index.html index e8c7706ef0..f86cb8b8b1 100644 --- a/files/fr/mozilla/add-ons/webextensions/api/pkcs11/getmoduleslots/index.html +++ b/files/fr/mozilla/add-ons/webextensions/api/pkcs11/getmoduleslots/index.html @@ -22,7 +22,7 @@ translation_of: Mozilla/Add-ons/WebExtensions/API/pkcs11/getModuleSlots <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox brush:js">var getting = browser.pkcs11.getModuleSlots( +<pre class="brush: js">var getting = browser.pkcs11.getModuleSlots( name // string ) </pre> diff --git a/files/fr/mozilla/add-ons/webextensions/api/pkcs11/index.html b/files/fr/mozilla/add-ons/webextensions/api/pkcs11/index.html index 84386b0441..1a3d2319bd 100644 --- a/files/fr/mozilla/add-ons/webextensions/api/pkcs11/index.html +++ b/files/fr/mozilla/add-ons/webextensions/api/pkcs11/index.html @@ -32,17 +32,17 @@ translation_of: Mozilla/Add-ons/WebExtensions/API/pkcs11 </li> <li> <p>Faites défiler vers le bas de la page et sous <strong>Certificats</strong> ou tapez sur <strong>Dispositifs de sécurité...<br> - <img alt="" src="https://mdn.mozillademos.org/files/16399/device_manager.png" style="border: 1px solid black; display: block; height: 320px; margin: 0px auto; width: 600px;"></strong></p> + <img alt="" src="device_manager.png"></strong></p> </li> <li> <p>Cliquez ou appuyez sur le bouton <strong>Charger</strong><br> - <img alt="" src="https://mdn.mozillademos.org/files/16400/load_device_driver.png" style="display: block; margin: 0 auto;"></p> + <img alt="" src="load_device_driver.png"></p> </li> <li> <p>Entrez un nom pour le module de sécurité, tel que "<em>Ma Base de données Client</em>"</p> - <div class="blockIndicator warning"> - <p>Faites attention à l'utilisation de caractères internationaux car il y a actuellement un bogue dans Firefox où les caractères internationaux peuvent causer des problèmes.</p> + <div class="warning"> + <p><strong>Attention :</strong> il y a actuellement un bogue dans Firefox où les caractères internationaux peuvent causer des problèmes.</p> </div> </li> <li> diff --git a/files/fr/mozilla/add-ons/webextensions/api/pkcs11/installmodule/index.html b/files/fr/mozilla/add-ons/webextensions/api/pkcs11/installmodule/index.html index 3163c01b65..a70fee644d 100644 --- a/files/fr/mozilla/add-ons/webextensions/api/pkcs11/installmodule/index.html +++ b/files/fr/mozilla/add-ons/webextensions/api/pkcs11/installmodule/index.html @@ -20,7 +20,7 @@ translation_of: Mozilla/Add-ons/WebExtensions/API/pkcs11/installModule <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox brush:js">var installing = browser.pkcs11.installModule( +<pre class="brush: js">var installing = browser.pkcs11.installModule( name, // string flags // integer ) @@ -49,23 +49,23 @@ translation_of: Mozilla/Add-ons/WebExtensions/API/pkcs11/installModule <p>Installe un module, puis dresse la liste de ses emplacements et liste les jetons qu'ils contiennent :</p> -<pre class="brush: js line-numbers language-js"><code class="language-js"><span class="keyword token">function</span> <span class="function token">onInstalled</span><span class="punctuation token">(</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> - <span class="keyword token">return</span> browser<span class="punctuation token">.</span>pkcs11<span class="punctuation token">.</span><span class="function token">getModuleSlots</span><span class="punctuation token">(</span><span class="string token">"my_module"</span><span class="punctuation token">)</span><span class="punctuation token">;</span> -<span class="punctuation token">}</span> - -<span class="keyword token">function</span> <span class="function token">onGotSlots</span><span class="punctuation token">(</span>slots<span class="punctuation token">)</span> <span class="punctuation token">{</span> - <span class="keyword token">for</span> <span class="punctuation token">(</span>slot <span class="keyword token">of</span> slots<span class="punctuation token">)</span> <span class="punctuation token">{</span> - console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span><span class="template-string token"><span class="string token">`Slot: </span><span class="interpolation token"><span class="interpolation-punctuation punctuation token">${</span>slot<span class="punctuation token">.</span>name<span class="interpolation-punctuation punctuation token">}</span></span><span class="string token">`</span></span><span class="punctuation token">)</span><span class="punctuation token">;</span> - <span class="keyword token">if</span> <span class="punctuation token">(</span>slot<span class="punctuation token">.</span>token<span class="punctuation token">)</span> <span class="punctuation token">{</span> - console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span><span class="template-string token"><span class="string token">`Contains token: </span><span class="interpolation token"><span class="interpolation-punctuation punctuation token">${</span>slot<span class="punctuation token">.</span>token<span class="punctuation token">.</span>name<span class="interpolation-punctuation punctuation token">}</span></span><span class="string token">`</span></span><span class="punctuation token">)</span><span class="punctuation token">;</span> - <span class="punctuation token">}</span> <span class="keyword token">else</span> <span class="punctuation token">{</span> - console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span><span class="string token">'Is empty'</span><span class="punctuation token">)</span><span class="punctuation token">;</span> - <span class="punctuation token">}</span> - <span class="punctuation token">}</span> -<span class="punctuation token">}</span> - -browser<span class="punctuation token">.</span>pkcs11<span class="punctuation token">.</span><span class="function token">installModule</span><span class="punctuation token">(</span><span class="string token">"my_module"</span><span class="punctuation token">)</span> -<span class="punctuation token">.</span><span class="function token">then</span><span class="punctuation token">(</span>onInstalled<span class="punctuation token">)</span> -<span class="punctuation token">.</span><span class="function token">then</span><span class="punctuation token">(</span>onGotSlots<span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre> +<pre class="brush: js">function onInstalled() { + return browser.pkcs11.getModuleSlots("my_module"); +} + +function onGotSlots(slots) { + for (slot of slots) { + console.log(`Slot: ${slot.name}`); + if (slot.token) { + console.log(`Contains token: ${slot.token.name}`); + } else { + console.log('Is empty'); + } + } +} + +browser.pkcs11.installModule("my_module") +.then(onInstalled) +.then(onGotSlots);</pre> <p>{{WebExtExamples}}</p> diff --git a/files/fr/mozilla/add-ons/webextensions/api/pkcs11/ismoduleinstalled/index.html b/files/fr/mozilla/add-ons/webextensions/api/pkcs11/ismoduleinstalled/index.html index 896a8a25eb..db549d86f7 100644 --- a/files/fr/mozilla/add-ons/webextensions/api/pkcs11/ismoduleinstalled/index.html +++ b/files/fr/mozilla/add-ons/webextensions/api/pkcs11/ismoduleinstalled/index.html @@ -20,7 +20,7 @@ translation_of: Mozilla/Add-ons/WebExtensions/API/pkcs11/isModuleInstalled <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox brush:js">var checking = browser.pkcs11.isModuleInstalled( +<pre class="brush: js">var checking = browser.pkcs11.isModuleInstalled( name // string ) </pre> diff --git a/files/fr/mozilla/add-ons/webextensions/api/pkcs11/uninstallmodule/index.html b/files/fr/mozilla/add-ons/webextensions/api/pkcs11/uninstallmodule/index.html index b2e2df819f..4d76345947 100644 --- a/files/fr/mozilla/add-ons/webextensions/api/pkcs11/uninstallmodule/index.html +++ b/files/fr/mozilla/add-ons/webextensions/api/pkcs11/uninstallmodule/index.html @@ -20,7 +20,7 @@ translation_of: Mozilla/Add-ons/WebExtensions/API/pkcs11/uninstallModule <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox brush:js">var uninstalling = browser.pkcs11.uninstallModule( +<pre class="brush: js">var uninstalling = browser.pkcs11.uninstallModule( name // string ) </pre> |