browserAction.isEnabled()

Returns true if the browser action is enabled. Returns the global status if the details parameter is omitted or empty, or all its properties are empty.

Syntax

js
let gettingIsEnabled = browser.browserAction.isEnabled(
  details // optional object or integer
)

Parameters

details Optional

integer or object. As an integer it defines the ID of a tab to check. As an object it contains:

tabId Optional

integer. ID of a tab to check.

windowId Optional

integer. ID of a window to check.

If windowId and tabId are supplied, the function fails.

Return value

A Promise fulfilled with true if the extension's browser action is enabled, and false otherwise.

Examples

Check the global state:

js
browser.browserAction.isEnabled({}).then((result) => {
  console.log(result);
});

Check the state of the active tab:

js
async function enabledInActiveTab() {
  let tabs = await browser.tabs.query({
    currentWindow: true,
    active: true,
  });
  let enabled = await browser.browserAction.isEnabled({
    tabId: tabs[0].id,
  });
  console.log(enabled);
}

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
isEnabled
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 59 (Release date: 2018-03-13)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15 (Release date: 2021-09-20)
footnote Full support
details (object)
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 59 (Release date: 2018-03-13)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15 (Release date: 2021-09-20)
footnote Full support
details.windowId
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 62 (Release date: 2018-09-05)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 18 (Release date: 2024-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 18 (Release date: 2024-09-16)
footnote Full support
details (integer, tabId)
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 149 (Release date: 2026-03-24)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 149 (Release date: 2026-03-24)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support