// reference registration
const registration = await navigator.serviceWorker.ready;
// feature detection
if ("index" in registration) {
// Content Index API functionality
const contentIndex = registration.index;
}ServiceWorkerRegistration: index property / notebook
ServiceWorkerRegistration: index 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 contentIndex = self.registration.index;