Service Workers

Transform Timers into Alarms#arrow-up-right

DOM-based timers, such as window.setTimeout() or window.setInterval(), are not honored

  let timeout = 1000 * 60 * 3;  // 3 minutes in milliseconds
  window.setTimeout(function() {
    alert('Hello, world!');
  }, timeout);

Instead, use the alarms APIarrow-up-right.

Then add a listener.

Last updated