Conversation
|
Preview URLs (2 pages)
External URLs (2)URL:
URL:
(comment last updated: 2026-09-10 23:19:06) |
|
|
||
| > [!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()")}}. |
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.
There was a problem hiding this comment.
@Rob--W I've added the w3c link. However, I'm unclear about:
clearAllwould reject if there is somehow a failure.
The implementation suggested it doesn't, or am I reading this incorrectly?
clearAll: function () {
for (let alarm of self.alarms.values()) {
alarm.clear();
}
},
could indeed call getAll, but before clearAll.
Why not after to confirm the clear all?
Co-authored-by: Rob Wu <rob@robwu.nl>
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