// reference registration
const registration = await navigator.serviceWorker.ready;
// feature detection
if ("periodicSync" in registration) {
// Background Periodic Sync functionality
const periodicSync = registration.periodicSync;
}ServiceWorkerRegistration: periodicSync property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
// service worker script
const periodicSync = self.registration.periodicSync;