Disable service workers when in development mode.

Kiba picture Kiba · Nov 24, 2016 · Viewed 16.1k times · Source

In case of our development, we serve files from https://localhost as the app is hosted in salesforce.com. In chrome service worker on chrome blocks anything coming from self-signed server i.e (https://localhost).

So is there a way to disable/unregister service workers when in development mode. Any pattern to follow for this.

Thanks

Answer

Aditya Singh picture Aditya Singh · Nov 29, 2016

You can use the chrome devtools, and under Application>Service Workers path select the Update on refresh checkbox

enter image description here

You can also use the Bypass for network checkbox to avoid Service worker's register event form firing.