pageAction.isShown()
Renvoie true
si l'action de la page est affichée pour l'onglet donné..
C'est une fonction asynchrone qui renvoie une Promise
.
Syntaxe
js
let gettingIsShown = browser.pageAction.isShown(
details, // object
);
Paramètres
Valeur retournée
Une Promise
qui sera remplie avec true
si l'action de page de l'extension est affichée pour l'onglet donné, et false
dans le cas contraire.
Compatibilité des navigateurs
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
isShown |
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.
Exemples
Vérifiez l'état de l'onglet actuellement actif :
js
async function shownInActiveTab() {
let tabs = await browser.tabs.query({
currentWindow: true,
active: true,
});
let shown = await browser.pageAction.isShown({
tabId: tabs[0].id,
});
console.log(shown);
}