In google dev tools -> Application -> Service Workers there is an option to unregister a service worker. If you do this the status of this service worker will also change to stopped.
When I unregister the service worker programmatically from the console with something like await (await navigator.serviceWorker.getRegistrations())[0].unregister() I get a true from the promise, so the service worker was unregistered. But the status in dev tools does not change into stopped. How can I programmatically stop the service worker like the dev tools are doing it when clicking Unregister or stop.
The service worker I am working with is created with create-reac-app / workbox. Find a basic example here: https://pwa-cra.vercel.app/