Definition
skipWaiting()
self.skipWaiting() is called inside a service worker's install (or activate) handler to skip the normal waiting state and activate immediately, even while older pages controlled by a previous worker are still open. It is usually paired with clients.claim() so the new worker also starts controlling those pages right away.
Typical usage: self.addEventListener("install", (event) => { self.skipWaiting(); event.waitUntil(precacheAssets()); });. Calling it unconditionally on every install means every deploy activates instantly for all open tabs, which trades update speed for a small risk of mismatched client/worker logic mid-session.
The safer alternative is to call skipWaiting() only in response to an explicit user action, such as clicking "Update now" on an in-app banner that listens for registration.waiting, giving users control over when the reload happens.
skipWaiting() only affects the transition from waiting to activating; it does not itself reload any open pages, so pages already loaded will keep running old JavaScript until they next navigate, even though the new worker is now in control of their fetch events.
Workbox's core module exposes a shorthand, workbox.core.skipWaiting() (or self.skipWaiting() directly with workbox-window's messageSkipWaiting()), which is the pattern most production Workbox configs use.