pageAction.isShown()
Gibt true
zurück, wenn die Seitenaktion für den angegebenen Tab angezeigt wird.
Dies ist eine asynchrone Funktion, die ein Promise
zurückgibt.
Syntax
js
let gettingIsShown = browser.pageAction.isShown(
details // object
)
Parameter
Rückgabewert
Ein Promise
, das mit true
erfüllt wird, wenn die Seitenaktion der Erweiterung für den angegebenen Tab angezeigt wird, und mit false
andernfalls.
Browser-Kompatibilität
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.
Beispiele
Überprüfen Sie den Status des aktuell aktiven Tabs:
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);
}