From 7e124631941d1d75c2bcb80c4b3004c47a2a6558 Mon Sep 17 00:00:00 2001 From: Richard Bloor Date: Tue, 8 Sep 2026 05:41:36 +1200 Subject: [PATCH 1/5] Bug 2067229 alarms.clearAll returns undefined --- .../webextensions/api/alarms/clearall/index.md | 18 +++++++++--------- .../mozilla/firefox/releases/157/index.md | 2 ++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/files/en-us/mozilla/add-ons/webextensions/api/alarms/clearall/index.md b/files/en-us/mozilla/add-ons/webextensions/api/alarms/clearall/index.md index a77db448dd0ae71..84efee0f2f02f07 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/alarms/clearall/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/alarms/clearall/index.md @@ -8,12 +8,10 @@ sidebar: addonsidebar Cancels all active alarms. -This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - ## Syntax ```js-nolint -let clearAlarms = browser.alarms.clearAll() +browser.alarms.clearAll() ``` ### Parameters @@ -22,20 +20,22 @@ None. ### Return value -A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) fulfilled with a boolean. This is `true` if any alarms were cleared, `false` otherwise. +A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) fulfilled with `undefined`. > [!NOTE] -> Chrome always passes `true` and Safari `undefined`. The return type is subject to change and may always return `undefined` for all browsers in the future. It is best to not rely on the return type. +> Before Firefox 157, the promise was fulfilled with a boolean: `true` if any alarms were cleared and `false` otherwise. Chrome fulfills the promise with `true` and Safari with `undefined`. Don't rely on the fulfillment value. To check whether any alarms remain, call {{WebExtAPIRef("alarms.getAll()")}}. ## Examples +Clear all the alarms the extension has scheduled, then log that the alarms are cleared: + ```js -function onClearedAll(wasCleared) { - console.log(wasCleared); // true/false +async function clearAllAlarms() { + await browser.alarms.clearAll(); + console.log("All alarms cleared"); } -let clearAlarms = browser.alarms.clearAll(); -clearAlarms.then(onClearedAll); +clearAllAlarms(); ``` {{WebExtExamples}} diff --git a/files/en-us/mozilla/firefox/releases/157/index.md b/files/en-us/mozilla/firefox/releases/157/index.md index 986998a383b8900..22b162bc5361070 100644 --- a/files/en-us/mozilla/firefox/releases/157/index.md +++ b/files/en-us/mozilla/firefox/releases/157/index.md @@ -72,6 +72,8 @@ Firefox 157 is the current [Nightly version of Firefox](https://www.firefox.com/ ## Changes for add-on developers +- [`alarms.clearAll()`](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/alarms/clearAll) now fulfills its promise with `undefined` instead of a boolean. Extensions that relied on the fulfillment value to determine whether any alarms were cleared should call [`alarms.getAll()`](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/alarms/getAll) instead. ([Firefox bug 2067229](https://bugzil.la/2067229)) + From 95c3554e98cf721e1913990e9b5cb9e024e06430 Mon Sep 17 00:00:00 2001 From: rebloor Date: Fri, 11 Sep 2026 07:14:16 +1200 Subject: [PATCH 2/5] Apply batched suggestions from @Rob--W review Co-authored-by: Rob Wu --- files/en-us/mozilla/firefox/releases/157/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/mozilla/firefox/releases/157/index.md b/files/en-us/mozilla/firefox/releases/157/index.md index 22b162bc5361070..03c8a34d0313c77 100644 --- a/files/en-us/mozilla/firefox/releases/157/index.md +++ b/files/en-us/mozilla/firefox/releases/157/index.md @@ -72,7 +72,7 @@ Firefox 157 is the current [Nightly version of Firefox](https://www.firefox.com/ ## Changes for add-on developers -- [`alarms.clearAll()`](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/alarms/clearAll) now fulfills its promise with `undefined` instead of a boolean. Extensions that relied on the fulfillment value to determine whether any alarms were cleared should call [`alarms.getAll()`](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/alarms/getAll) instead. ([Firefox bug 2067229](https://bugzil.la/2067229)) +- [`alarms.clearAll()`](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/alarms/clearAll) now fulfills its promise with `undefined` instead of a boolean. ([Firefox bug 2067229](https://bugzil.la/2067229)) From fa96916d89f886d362692e16fb2f1106685c7290 Mon Sep 17 00:00:00 2001 From: Richard Bloor Date: Fri, 11 Sep 2026 11:15:35 +1200 Subject: [PATCH 3/5] More details link --- .../add-ons/webextensions/api/alarms/clearall/index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/en-us/mozilla/add-ons/webextensions/api/alarms/clearall/index.md b/files/en-us/mozilla/add-ons/webextensions/api/alarms/clearall/index.md index 84efee0f2f02f07..bac7edaee68b75b 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/alarms/clearall/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/alarms/clearall/index.md @@ -23,7 +23,9 @@ None. A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) fulfilled with `undefined`. > [!NOTE] -> Before Firefox 157, the promise was fulfilled with a boolean: `true` if any alarms were cleared and `false` otherwise. Chrome fulfills the promise with `true` and Safari with `undefined`. Don't rely on the fulfillment value. To check whether any alarms remain, call {{WebExtAPIRef("alarms.getAll()")}}. +> Before Firefox 157, the promise was fulfilled with a boolean: `true` if any alarms were cleared and `false` otherwise. Chrome fulfills the promise with `true` and Safari with `undefined`. Don't rely on the fulfillment value. See [w3c/webextensions#1055](https://github.com/w3c/webextensions/issues/1055) for details. +> +> To check whether any alarms remain, call {{WebExtAPIRef("alarms.getAll()")}}. ## Examples From 8e35215f282054a9ef5514665abad08b73dbe038 Mon Sep 17 00:00:00 2001 From: rebloor Date: Wed, 30 Sep 2026 04:48:28 +1300 Subject: [PATCH 4/5] Apply suggestion from @bershanskiy --- .../mozilla/add-ons/webextensions/api/alarms/clearall/index.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/files/en-us/mozilla/add-ons/webextensions/api/alarms/clearall/index.md b/files/en-us/mozilla/add-ons/webextensions/api/alarms/clearall/index.md index bac7edaee68b75b..0226bff846f6e93 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/alarms/clearall/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/alarms/clearall/index.md @@ -24,8 +24,6 @@ A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) fulfi > [!NOTE] > Before Firefox 157, the promise was fulfilled with a boolean: `true` if any alarms were cleared and `false` otherwise. Chrome fulfills the promise with `true` and Safari with `undefined`. Don't rely on the fulfillment value. See [w3c/webextensions#1055](https://github.com/w3c/webextensions/issues/1055) for details. -> -> To check whether any alarms remain, call {{WebExtAPIRef("alarms.getAll()")}}. ## Examples From 805f4e51b93c9e44e24fe5bb0947c11ff74a1af7 Mon Sep 17 00:00:00 2001 From: Richard Bloor Date: Fri, 2 Oct 2026 07:12:56 +1300 Subject: [PATCH 5/5] Release note macro correction --- files/en-us/mozilla/firefox/releases/157/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/mozilla/firefox/releases/157/index.md b/files/en-us/mozilla/firefox/releases/157/index.md index d688e3388517e32..eec576356756f9f 100644 --- a/files/en-us/mozilla/firefox/releases/157/index.md +++ b/files/en-us/mozilla/firefox/releases/157/index.md @@ -47,7 +47,7 @@ No notable changes. ## Changes for add-on developers -- [`alarms.clearAll()`](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/alarms/clearAll) now fulfills its promise with `undefined` instead of a boolean. ([Firefox bug 2067229](https://bugzil.la/2067229)) +- {{WebExtAPIRef("alarms.clearAll()")}} now fulfills its promise with `undefined` instead of a boolean. ([Firefox bug 2067229](https://bugzil.la/2067229)) ## Experimental web features