The first attempt to provide the Web applications an ability to be notified according to the system-level scheduler was called Web Alarms API. It was abandoned in 2013 in favor of the newer Task Scheduler API proposal based on Service Worker primitives.
The API's idea is to act as a wrapper for the underlying operating system scheduler and allow authorized Web applications implementing scenarios such as alarms, reminders or periodic data synchronization. It is supposed to be able to wake up the system at the specific time or in the first possible moment after the scheduled time and run the user-defined handler within the Service Worker instance.
The API is not implemented by any browser vendor as of the end of 2017 and no browser vendor seem to signal any interest.
.then(reg => reg.taskScheduler.add(time, [data])
- Schedules an event to be triggered within the Service Worker instance at the specified
timewith the specified
- Returns a
Promiseresolved with the events already scheduled by the current application.
- An event fired within the Service Worker at the scheduled time (or as soon as it is possible after) with the