Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/mozilla/add-ons/webextensions/api/alarms/getall/index.md
6581 views
---
title: alarms.getAll() slug: Mozilla/Add-ons/WebExtensions/API/alarms/getAll page-type: webextension-api-function tags: - API - Add-ons - Extensions - Method - Non-standard - Reference - WebExtensions - alarms - getAll browser-compat: webextensions.api.alarms.getAll
---

{{AddonSidebar()}}

Gets all active alarms for the extension.

This is an asynchronous function that returns a Promise.

Syntax

let getAlarms = browser.alarms.getAll()

Parameters

None.

Return value

A Promise that will be fulfilled with an array of Alarm objects. Each of these represents an active alarm that belongs to the extension. If no alarms are active, the array will be empty.

Examples

function gotAll(alarms) { for (const alarm of alarms) { console.log(alarm.name); } } browser.alarms.getAll().then(gotAll);

{{WebExtExamples}}

Browser compatibility

{{Compat}}

Note: This API is based on Chromium's chrome.alarms API.