title: ServiceWorkerContainer.ready for a specific scriptURL?
body: <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/ready" rel="nofollow">ServiceWorkerContainer.ready</a> 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?</p>
  
  <p>That is, how can I write a function <code>registerReady(scriptURL, options)</code> that can be used as follows:</p>
  
  <pre><code>registerReady("foo.js").then(function (r) {
      // "foo.js" is active and r.active === navigator.serviceWorker.controller
      fetch("/"); // uses foo.js's "fetch" handler
  });
  
  registerReady("bar.js").then(function (r) {
      // "bar.js" is active and r.active === navigator.serviceWorker.controller
      fetch("/"); // use bar.js's "fetch" handler
  });
  </code></pre>