Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

147
Views
Is there a way to know if a service worker has been terminated or restarted?

We can't rely on global variables in a service worker, as the global state is wiped out each time the service worker is terminated (and eventually restarted).

How does one know when the service worker has been terminated? How does one know when it is restarted? There doesn't seem to be any lifecycle event that we can hook into.

What I'm looking for is something like self.addEventListener('terminate', async () => { and/or self.addEventListener('restart', async () => {.

Am I missing something? 🤨

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!