From b7217ba37e5bee8c27eed86019b4b112482dec1a Mon Sep 17 00:00:00 2001 From: Richard Bloor Date: Tue, 3 Feb 2026 06:57:39 +1300 Subject: [PATCH 1/2] Bug-2012727 `isEnabled` updates for `action` and `browseAction` --- .../webextensions/api/action/isenabled/index.md | 15 ++++++++------- .../api/browseraction/isenabled/index.md | 12 +++++------- 2 files changed, 13 insertions(+), 14 deletions(-) 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() { From b6ea5f305663fca5a13ff02c0d9670447968a35f Mon Sep 17 00:00:00 2001 From: Richard Bloor Date: Thu, 19 Feb 2026 07:11:18 +1300 Subject: [PATCH 2/2] Bug 2013477 Support action.isEnabled(tabId) next to action.isEnabled(details) --- .../webextensions/api/action/isenabled/index.md | 14 ++++++-------- .../api/browseraction/isenabled/index.md | 14 ++++++-------- files/en-us/mozilla/firefox/releases/149/index.md | 2 ++ 3 files changed, 14 insertions(+), 16 deletions(-) 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 3371ae18ac963ff..6d580db01437e5f 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 @@ -6,7 +6,7 @@ browser-compat: webextensions.api.action.isEnabled sidebar: addonsidebar --- -Returns `true` if the browser action is enabled. +Returns `true` if the browser action is enabled. Returns the global status if the parameters are omitted or all are empty. > [!NOTE] > This API is available in Manifest V3 or higher. @@ -15,23 +15,21 @@ Returns `true` if the browser action is enabled. ```js-nolint let gettingIsEnabled = browser.action.isEnabled( - details // object + details, // optional object + tabId // optional integer ) ``` ### Parameters - `details` {{optional_inline}} - - : `object`. An object optionally containing the `tabId` or `windowId` to check. + - : `object`. An object optionally containing the `tabId` or `windowId` to check. If `windowId` and `tabId` are supplied, the function fails. - `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 supplied, the function fails. -- If `details`, or `windowId` and `tabId` are omitted, the global status is returned. +- `tabId` {{optional_inline}} + - : `integer`. ID of a tab to check. > [!NOTE] > Chrome doesn't support the `details` object. It provides for setting an optional `tabId` only. 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 e0a3e6e838c2a66..5f0c8b71926a820 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 @@ -6,29 +6,27 @@ browser-compat: webextensions.api.browserAction.isEnabled sidebar: addonsidebar --- -Returns `true` if the browser action is enabled. +Returns `true` if the browser action is enabled. Returns the global status if the parameters are omitted or all are empty. ## Syntax ```js-nolint let gettingIsEnabled = browser.browserAction.isEnabled( - details // object + details, // optional object + tabId // optional integer ) ``` ### Parameters - `details` {{optional_inline}} - - : `object`. An object optionally containing the `tabId` or `windowId` to check. + - : `object`. An object optionally containing the `tabId` or `windowId` to check. If `windowId` and `tabId` are supplied, the function fails. - `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 supplied, the function fails. -- If `details`, or `windowId` and `tabId` are omitted, the global status is returned. +- `tabId` {{optional_inline}} + - : `integer`. ID of a tab to check. ### Return value diff --git a/files/en-us/mozilla/firefox/releases/149/index.md b/files/en-us/mozilla/firefox/releases/149/index.md index d674ff34d5d9c98..bd201fea0171c8e 100644 --- a/files/en-us/mozilla/firefox/releases/149/index.md +++ b/files/en-us/mozilla/firefox/releases/149/index.md @@ -72,6 +72,8 @@ Firefox 149 is the current [Nightly version of Firefox](https://www.firefox.com/ ## Changes for add-on developers +- Adds support for `tabId` as a top-level parameter in {{WebExtAPIRef("action.isEnabled")}} and {{WebExtAPIRef("browserAction.isEnabled")}}. This change provides for compatibility with the Chrome implementation of `action.isEnabled`. ([Firefox bug 2013477](https://bugzil.la/2013477)) +