MozAlarmsManager.remove

  • Revision slug: Web/API/MozAlarmsManager.remove
  • Revision title: MozAlarmsManager.remove
  • Revision id: 447171
  • Created:
  • Creator: Gene
  • Is current revision? No
  • Comment

Revision Content

{{ non-standard_header() }}

{{ B2GOnlyHeader2('installed') }}

Summary

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

Syntax

var request = navigator.mozAlarms.remove(id);

Properties

id
A number representing the id of the alarm to be removed.

Return

None.

Example

var request = navigator.mozAlarms.getAll();

request.onsuccess = function () {
  // Remove all pending alarms
  this.result.forEach(function (alarm) {
    navigator.mozAlarms.remove(alarm.id);
  });
}

request.onerror = function () {
  console.log('operation failed: ' + this.error);
}

Specification

Specification Status Comment
{{ SpecName('Alarm API', '#interface-alarmmanager') }} {{ Spec2('Alarm API') }} Defines the AlarmManager interface.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatNo()}} {{CompatNo()}} {{CompatNo()}} {{CompatNo()}} {{CompatNo()}}
Feature Android Firefox OS Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatNo()}} 1.0 {{CompatNo()}} {{CompatNo()}} {{CompatNo()}} {{CompatNo()}}

Gecko implementation note

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

  • {{domxref("MozAlarmsManager")}}
  • {{domxref("DOMRequest")}}

Revision Source

<p>{{ non-standard_header() }}</p>
<p>{{ B2GOnlyHeader2('installed') }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>remove</code> method is used to retrieve a list of pending alarms.</p>
<h2 id="Syntax">Syntax</h2>
<pre>
var request = navigator.mozAlarms.remove(id);</pre>
<h3 id="Properties">Properties</h3>
<dl>
  <dt>
    id</dt>
  <dd>
    A number representing the id of the alarm to be removed.</dd>
</dl>
<h3 id="Return">Return</h3>
<p>None.</p>
<h2 id="Example">Example</h2>
<pre class="brush: js">
var request = navigator.mozAlarms.getAll();

request.onsuccess = function () {
  // Remove all pending alarms
  this.result.forEach(function (alarm) {
    navigator.mozAlarms.remove(alarm.id);
  });
}

request.onerror = function () {
  console.log('operation failed: ' + this.error);
}
</pre>
<h2 id="Specification">Specification</h2>
<table class="standard-table">
  <tbody>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
    <tr>
      <td>{{ SpecName('Alarm API', '#interface-alarmmanager') }}</td>
      <td>{{ Spec2('Alarm API') }}</td>
      <td>Defines the <code>AlarmManager</code> interface.</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari (WebKit)</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{CompatNo()}}</td>
        <td>{{CompatNo()}}</td>
        <td>{{CompatNo()}}</td>
        <td>{{CompatNo()}}</td>
        <td>{{CompatNo()}}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox OS</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{CompatNo()}}</td>
        <td>1.0</td>
        <td>{{CompatNo()}}</td>
        <td>{{CompatNo()}}</td>
        <td>{{CompatNo()}}</td>
        <td>{{CompatNo()}}</td>
      </tr>
    </tbody>
  </table>
</div>
<h3 id="Gecko_implementation_note">Gecko implementation note</h3>
<p>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.</p>
<h2 id="See_also">See also</h2>
<ul>
  <li>{{domxref("MozAlarmsManager")}}</li>
  <li>{{domxref("DOMRequest")}}</li>
</ul>
Revert to this revision