This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Note: This feature is only available in Service Workers.
The periodicsync event of the ServiceWorkerGlobalScope interface is fired at timed intervals, specified when registering a PeriodicSyncManager.
This event is not cancelable and does not bubble.
Use the event name in methods like addEventListener(), or set an event handler property.
addEventListener("periodicsync", (event) => { })
onperiodicsync = (event) => { }
A PeriodicSyncEvent. Inherits from Event.
Inherits properties from its ancestor, Event.
PeriodicSyncEvent.tag Read only
Returns the developer-defined identifier for this PeriodicSyncEvent. Multiple tags can be used by the web app to run different periodic tasks at different frequencies.
The following example shows how to respond to a periodic sync event in the service worker.
self.addEventListener("periodicsync", (event) => {
if (event.tag === "get-latest-news") {
event.waitUntil(fetchAndCacheLatestNews());
}
});
You can also set up the event handler using the onperiodicsync property:
self.onperiodicsync = (event) => {
// …
};
| Specification |
|---|
| Web Periodic Background Synchronization> # periodicsync-event> |
| Web Periodic Background Synchronization> # dom-serviceworkerglobalscope-onperiodicsync> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
periodicsync_event |
80 | 80 | No | 67 | No | 80 | No | 57 | No | 13.0 | No | No |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/periodicsync_event