The first thing I would look at when debugging is whether the current page you are on falls within the scope of the worker. If your current page is not under an area, then it will not be controlled (but a registered service worker can still be considered active).
You call register(SERVICE_WORKER_URL) , which by default will use the directory that contains your working script service as the scope. This is usually what you need, but you need to make sure SERVICE_WORKER_URL refers to the script located at the root of your website. Thus, he will be able to control pages both at one root level, and on pages in directories under your web root. Therefore, if your JavaScript service file is running in the /scripts/ subdirectory or something like that, move it to the root directory.
You can check the current scope of your service worker by visiting chrome://serviceworker-internals/ and see what scope is associated with your registration.
Jeff posnick
source share