Affiche un ou plusieurs onglets précédemment masqués par un appel à tabs.hide
.
C'est une fonction asynchrone qui renvoie une Promise
.
Syntaxe
var showing = browser.tabs.show(
tabIds // integer or integer array
)
Paramètres
tabIds
orinteger
ofarray
. Les ID de l'onglet ou des onglets à afficher.integer
Valeur retournée
Une Promise
qui sera accomplie sans arguments. Si une erreur se produit, la promesse sera rejetée avec un message d'erreur.
Exemples
Afficher un seul onglet :
function onShown() {
console.log(`Shown`);
}
function onError(error) {
console.log(`Error: ${error}`);
}
browser.tabs.show(2).then(onShown, onError);
Afficher plusieurs onglets :
function onShown() {
console.log(`Shown`);
}
function onError(error) {
console.log(`Error: ${error}`);
}
browser.tabs.show([15, 14, 1]).then(onShown, onError);
Compatibilité du navigateur
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.