service worker registration
The call, navigator.serviceWorker.register('/sw.js'), that asks the browser to install a service worker for a scope of URLs.
In more detail
The browser downloads the script, and checks it again for updates on later navigations. The scope defaults to the folder the script is served from.
Related terms
- service worker — A script the browser runs in the background, separate from pages, that can intercept a site's network requests and act as a programmable proxy.
- service worker lifecycle — The states a service worker passes through: installing, installed and waiting, activating, activated, and finally redundant when replaced or failed.
Taught in
- Service Worker Lifecycle: Installation, Activation And Update — Frontend Architecture & Web Platform
- Background Sync, Push Notifications And PWA Manifests — Frontend Architecture & Web Platform