clients.claim()

A service worker method that makes a newly activated worker take control of pages that are already open.

In more detail

It is usually called inside the activate event handler. Without it, a worker only controls pages loaded after it activated, so the first visit is not intercepted.

Related terms

Taught in

References