Is there a way to list all the browsers registered service-workers? Lets say that I have registered/installed a few service workers. can I get a list an array of the file names via js?
Apparently I have found two ways that works fine for me (for chrome): one is using shortcut command:
chrome://serviceworker-internals/
Other one is:
go to Developers Tool -> Resources -> Service Workers
There isn't a way to get "all the browser's" registered service workers programmatically from a web page, since a web page can only access the service workers that are registered for its scope. But if you're looking for a way to get those, then call navigator.serviceWorker.getRegistrations
to get a promise that resolves to an array of registered service workers:
navigator.serviceWorker.getRegistrations().then(function(registrations) {
registrations.forEach(function(v) { console.log('service worker: ' + v) });
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With