Glossary

Definition

Service worker

Short definition

A service worker is a JavaScript file the browser runs in the background, separate from the page. It intercepts network requests, caches responses so the site works offline, and receives web-push events so the site can notify the user when it is closed.

Reviewed July 8, 2026

Service workers are one of the three requirements Chromium browsers check before offering the PWA install prompt (the others are HTTPS and a Web App Manifest).

They register once per origin and scope, live longer than any single page, and survive tab close. The browser wakes them for fetch, push and sync events.

Because they run outside the page, service workers cannot touch the DOM. They communicate with pages via postMessage or by mutating the cache the page reads from.

Related terms
Web App Manifest
A Web App Manifest is a JSON file (usually manifest.webmanifest) that declares your app's name, icons, start URL, theme colour and display mode. The browser reads it to render the install prompt and the home-screen icon.
Web push
Web push is a W3C standard that lets a website deliver push notifications to a user's device via the browser's push service, even when the site is closed. Delivery requires a service worker and explicit user permission.
Standalone display mode
Standalone is a value of the display field in a Web App Manifest. It tells the browser to launch the PWA in its own window with no address bar or tabs, so it looks and behaves like a native app. It is the most common display mode for installable PWAs.
beforeinstallprompt
beforeinstallprompt is a window event Chromium browsers fire when a site meets the PWA install criteria. Capturing the event and calling prompt() later lets you show the install dialog at a moment of your choosing instead of at page load.
name (manifest field)
name is a required-in-practice string field in the Web App Manifest that gives the full, human-readable title of the app. Browsers show it on the install dialog, the splash screen and in the OS app switcher. It can be up to 45 characters before some UIs truncate it.
short_name (manifest field)
short_name is an optional manifest string, typically under 12 characters, used wherever screen space is limited — the home-screen label, the app switcher, or a launcher grid. When short_name is absent the browser falls back to the full name field, which may get truncated with an ellipsis.