• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. B2G OS APIs
  5. MozAlarmsManager
  6. MozAlarmsManager.getAll()

MozAlarmsManager.getAll()

In This Article
  1. Syntax
    1. Return
    2. mozAlarm
  2. Example
  3. Specification
  4. Browser compatibility
  5. See also

This API is available on Firefox or Firefox OS for installed or higher privileged applications.

The getAll method is used to retrieve a list of pending alarms.

Syntax

var request = navigator.mozAlarms.getAll();

Return

A DOMRequest object to handle the success or failure of the method call.

If the method call is successful, the request's result will be an array of mozAlarm objects.

mozAlarm

Those objects are anonymous JavaScript objects with the following properties:

id
A number representing the id of the alarm
date
A Date object representing the scheduled time for the alarm
respectTimezone
A string indicating if the alarm must respect or ignore the timezone information of the date object. Its value can be ignoreTimezone or honorTimezone
data
A JavaScript object contaning any data that were stored with the alarm

Example

var request = navigator.mozAlarms.getAll();
request.onsuccess = function () {
  console.log('operation successful:' + this.result.length + 'alarms pending');
  this.result.forEach(function (alarm) {
    console.log(alarm.id + ' : ' + alarm.date.toString() + ' : ' + alarm.respectTimezone);    
  });
}
request.onerror = function () {
  console.log('operation failed: ' + this.error);
}

Specification

Specification Status Comment
Web Alarms API Working Draft Defines the AlarmManager interface.

Browser compatibility

  • Desktop
  • Mobile
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support No support No support No support No support No support
Feature Android Firefox OS Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support No support 1.0[1] No support No support No support No support

[1] This API is currently available on Firefox OS only for any installed applications. The current specification for this API is not considered stable enough to unprefix the API yet.

See also

  • MozAlarmsManager
  • DOMRequest

Document Tags and Contributors

Tags: 
  • alarm
  • API
  • B2G
  • Firefox OS
  • Method
  • Non Standard
  • Reference
  • WebAPI
 Contributors to this page: chrisdavidmills, teoli, Sebastianz, kscarfone, Gene, Sheppy, Jeremie
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:33:42 AM
See also
  1. Alarm API
  2. Archive
  3. Related pages for Alarm API
    1. MozAlarmsManager
    2. Navigator.mozSetMessageHandler()