Skip to content

Bug 2067229 alarms.clearAll returns undefined - #45554

Open
rebloor wants to merge 1 commit into
mdn:mainfrom
rebloor:Bug-2067229-alarms.clearAll-returns-undefined
Open

Bug 2067229 alarms.clearAll returns undefined#45554
rebloor wants to merge 1 commit into
mdn:mainfrom
rebloor:Bug-2067229-alarms.clearAll-returns-undefined

Conversation

@rebloor

@rebloor rebloor commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Description

Addresses the dev-docs-needed requirements of Bug 2067229 "alarms.clearAll should return undefined instead of a boolean" with:

  • update to alarms.clearAll
  • addition of 157 release note

Related issues and pull requests

BCG changes in mdn/browser-compat-data#30450

@rebloor
rebloor requested a review from Rob--W September 7, 2026 17:47
@rebloor rebloor self-assigned this Sep 7, 2026
@rebloor
rebloor requested review from a team as code owners September 7, 2026 17:47
@rebloor
rebloor removed the request for review from a team September 7, 2026 17:47
@rebloor rebloor added the Content:WebExt WebExtensions docs label Sep 7, 2026
@rebloor
rebloor requested a review from pepelsbey September 7, 2026 17:47
@github-actions github-actions Bot added Content:Firefox Content in the Mozilla/Firefox subtree size/s [PR only] 6-50 LoC changed labels Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Preview URLs (2 pages)

External URLs (1)

URL: /en-US/docs/Mozilla/Firefox/Releases/157
Title: Firefox 157 release notes for developers (Nightly)


> [!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()")}}.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:Firefox Content in the Mozilla/Firefox subtree Content:WebExt WebExtensions docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants