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

124
Views
Why did the browser never update itself from zombie service worker?

In this brillant talk Alexander Pope: ServiceWorkers Outbreak: index-sw-9a4c43b4b47781ca619eaaf5ac1db.js | JSConf EU 2017: The presenter has a situation where a broken service worker gets installed, and its stuck in the broken state. The presenter tries a kill switch and an empty service worker to remedey it, but there are still some browsers permantely infected. I am trying to understand why it happened, and not do a similar thing.

Here is his code (from 22m:57s):

function onInstall(event) {
    event.waitUntil(
        install(config.version, config.assets)
            .catch((err) => {
                reportError(err);
                // Ok, you know what you're doing, Installing now....
            })
    );
}

It gets stuck because within the call to install he uses cache.addAll(), but long ago Chrome didnt support cache, so this error never bubbled up, and the browser thought it was installed correctly.

Now the browser is reponsible for fetching the sw.js file and checking if its byte different to the currently installed worker. The code to register the new sw.js file is outside of the service worker file. This means even if a service worker is broken, the browser should be able to fetch the new one, determine its different, register it, and activate it (eventually). The newer sw.js file could then check for the presence of cache API. So why are there some clients still in a broken state?

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!