Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Latest commit

 

History

History

immediate-claim

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Immediate Claim

This recipe shows how to have the service worker immediately take control of the page without waiting for a navigation event.

Difficulty

Beginner

Use Case

Basic service worker registration requires a navigation event to occur before the service worker starts working. This recipe illustrates a trick you can use for the service worker to immediately start working upon install.

Features and Usage

  • Register a service worker
  • Delete old cache if present
  • Immediately claim the service worker

Category

General Usage