Path: blob/main/files/en-us/mozilla/add-ons/webextensions/api/browseraction/isenabled/index.md
6581 views
------{{AddonSidebar()}}
Returns true if the browser action is enabled.
This is an asynchronous function that returns a Promise.
Syntax
Parameters
details:
object. An object optionally containing thetabIdorwindowIdto check.tabId{{optional_inline}}:
integer. ID of a tab to check.
windowId{{optional_inline}}:
integer. ID of a window to check.
If windowId and tabId are both supplied, the function fails.
If windowId and tabId are both omitted, the global enabled/disabled status is returned.
Return value
A Promise that will be fulfilled with true if the extension's browser action is enabled, and false otherwise.
Browser compatibility
{{Compat}}
Examples
Check the global state:
Check the state of the currently active tab:
{{WebExtExamples}}