ServiceWorkerContainer.ready for a specific scriptURL?
问题 ServiceWorkerContainer.ready resolves to an active ServiceWorkerRegistration, but if there are multiple service workers in play (e.g. service workers from previous page loads, multiple registrations within the same page) there are multiple service workers it could resolve to. How can I make sure that a particular service worker is handling network events when a chunk of code is executed? That is, how can I write a function registerReady(scriptURL, options) that can be used as follows: