tabs.show()
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
js
var showing = browser.tabs.show(
tabIds, // integer or integer array
);
Paramètres
tabIds
-
integer
orarray
ofinteger
. Les ID de l'onglet ou des onglets à afficher.
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 :
js
function onShown() {
console.log(`Shown`);
}
function onError(error) {
console.log(`Error: ${error}`);
}
browser.tabs.show(2).then(onShown, onError);
Afficher plusieurs onglets :
js
function onShown() {
console.log(`Shown`);
}
function onError(error) {
console.log(`Error: ${error}`);
}
browser.tabs.show([15, 14, 1]).then(onShown, onError);
Compatibilité des navigateurs
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
show |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on 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.