diff --git a/files/en-us/mozilla/add-ons/webextensions/api/action/isenabled/index.md b/files/en-us/mozilla/add-ons/webextensions/api/action/isenabled/index.md index f75a9544ef2a7d8..3371ae18ac963ff 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/action/isenabled/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/action/isenabled/index.md @@ -11,8 +11,6 @@ Returns `true` if the browser action is enabled. > [!NOTE] > This API is available in Manifest V3 or higher. -This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - ## Syntax ```js-nolint @@ -23,7 +21,7 @@ let gettingIsEnabled = browser.action.isEnabled( ### Parameters -- `details` +- `details` {{optional_inline}} - : `object`. An object optionally containing the `tabId` or `windowId` to check. - `tabId` {{optional_inline}} - : `integer`. ID of a tab to check. @@ -32,12 +30,15 @@ let gettingIsEnabled = browser.action.isEnabled( -- If windowId and tabId are both supplied, the function fails. -- If windowId and tabId are both omitted, the global enabled/disabled status is returned. +- If `windowId` and `tabId` are supplied, the function fails. +- If `details`, or `windowId` and `tabId` are omitted, the global status is returned. + +> [!NOTE] +> Chrome doesn't support the `details` object. It provides for setting an optional `tabId` only. ### Return value -A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will be fulfilled with `true` if the extension's browser action is enabled, and `false` otherwise. +A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) fulfilled with `true` if the extension's browser action is enabled, and `false` otherwise. ## Examples @@ -49,7 +50,7 @@ browser.action.isEnabled({}).then((result) => { }); ``` -Check the state of the currently active tab: +Check the state of the active tab: ```js async function enabledInActiveTab() { diff --git a/files/en-us/mozilla/add-ons/webextensions/api/browseraction/isenabled/index.md b/files/en-us/mozilla/add-ons/webextensions/api/browseraction/isenabled/index.md index ff283091d2b4fef..e0a3e6e838c2a66 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/browseraction/isenabled/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/browseraction/isenabled/index.md @@ -8,8 +8,6 @@ sidebar: addonsidebar Returns `true` if the browser action is enabled. -This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - ## Syntax ```js-nolint @@ -20,7 +18,7 @@ let gettingIsEnabled = browser.browserAction.isEnabled( ### Parameters -- `details` +- `details` {{optional_inline}} - : `object`. An object optionally containing the `tabId` or `windowId` to check. - `tabId` {{optional_inline}} - : `integer`. ID of a tab to check. @@ -29,12 +27,12 @@ let gettingIsEnabled = browser.browserAction.isEnabled( -- If windowId and tabId are both supplied, the function fails. -- If windowId and tabId are both omitted, the global enabled/disabled status is returned. +- If `windowId` and `tabId` are supplied, the function fails. +- If `details`, or `windowId` and `tabId` are omitted, the global status is returned. ### Return value -A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will be fulfilled with `true` if the extension's browser action is enabled, and `false` otherwise. +A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) fulfilled with `true` if the extension's browser action is enabled, and `false` otherwise. ## Examples @@ -46,7 +44,7 @@ browser.browserAction.isEnabled({}).then((result) => { }); ``` -Check the state of the currently active tab: +Check the state of the active tab: ```js async function enabledInActiveTab() {