Anthony
Anthony

Reputation: 14309

Stop browser from requesting service-worker.js from server

On a former project I was working on there was a manifest.json file while allowed the app to be a progressive web application.

However even now on different projects I can see that my browser is requesting the service-worker.js file from the backend ie:

GET /service-worker.js 404 557.926 ms

How can I turn this off within my browser so I don't see these errant logs come through my app?

Upvotes: 4

Views: 1709

Answers (1)

Anthony
Anthony

Reputation: 14309

You need to unregister the service worker like such:

https://www.codementor.io/@himank/how-to-unregister-service-workers-n8mzf5jce

In case the link should stop working, these are the steps for Chrome.

  1. open the dev console
  2. click "Application" tab
  3. click "Service Workers"
  4. click "Unregister"

enter image description here

Upvotes: 4

Related Questions