MDN self-hosted library · e01.org

ServiceWorkerRegistration: periodicSync property

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
// reference registration
const registration = await navigator.serviceWorker.ready;

// feature detection
if ("periodicSync" in registration) {
  // Background Periodic Sync functionality
  const periodicSync = registration.periodicSync;
}
js
// service worker script

const periodicSync = self.registration.periodicSync;