After deleting /serviceworker.js
from my root directory, Chrome still runs the service worker that I removed from my webroot. How do I uninstall the service worker from my website and Chrome so I can log back into my website?
I've tracked the issue down to Service Work's cache mechanism and I just want to remove for now until I have time to debug it. The login script that I'm using redirects to Google's servers for them to login to their Google account. But all I get from the login.php page is an ERR_FAILED
message.
You can also go to the URL: chrome://serviceworker-internals/ and unregister a serviceworker from there.
You should detecte two API in your devices: getRegistrations and getRegistration. The service-worker not has a unique set of APIs in all platforms. For example, some browsers only have a
navigator.serviceWorker.getRegistration
, nonavigator.serviceWorker.getRegistrations
. So you should consider with both.In Google Chrome, you can go to Developer tools (F12) -> Application -> Service worker and unregister the service workers from the list for that specific domain.
This method is effective in development mode of a site and mostly they run on
localhost
which is you may need for other project's development.You can remove service workers programmatically like this:
Docs: getRegistrations, unregister
You can also remove service workers under the Application tab in Chrome Devtools.
You can do this through Chrome Developer Tool as well as Programatically.
Find all running instance or service worker by typing
in a new tab and then select the serviceworker you want to unregister.
Open Developer Tools (F12) and Select Application. Then Either
or
Programatically