Bug 2067229 alarms.clearAll returns undefined - #45554
Open
rebloor wants to merge 1 commit into
Open
Conversation
Contributor
|
Preview URLs (2 pages)
External URLs (1)URL:
|
Rob--W
reviewed
Sep 9, 2026
|
|
||
| > [!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()")}}. |
Member
There was a problem hiding this comment.
clearAll would reject if there is somehow a failure.
Extensions typically don't need to know whether there are alarms. If they do the could indeed call getAll, but before clearAll.
Note that eventually all browsers will return undefined, so until that happens, it may make sense to refer to w3c/webextensions#1055 for reference.
|
|
||
| ## 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)) |
Member
There was a problem hiding this comment.
Suggested change
| - [`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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Addresses the dev-docs-needed requirements of Bug 2067229 "alarms.clearAll should return undefined instead of a boolean" with:
Related issues and pull requests
BCG changes in mdn/browser-compat-data#30450