title: navigator.serviceWorker.ready not fireing when sw placed in subfolder
body: <p>Our app is served (by IIS in a virtual application) from <a href="https://myserver.com/myapp" rel="nofollow noreferrer">https://myserver.com/myapp</a></p>
  
  <p>The HTML returned from <a href="https://myserver.com/myapp" rel="nofollow noreferrer">https://myserver.com/myapp</a> are:</p>
  
  <pre><code>&lt;html&gt;
    &lt;!-- This file is served as a virtual application from https://myserver.com/myapp--&gt;
    &lt;head&gt;
      &lt;script src="/myapp/file.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>To register the serviceworker I need to add the subfolder as shown below</p>
  
  <pre><code>// This does not work since the app is served from /myapp
  navigator.serviceWorker.register("/sw.js")  // Fail, will try loading https://myServer.com/sw.js
  
  // This works (registration successful)
  navigator.serviceWorker.register("/myapp/sw.js")  // This will register the sw.
  </code></pre>
  
  <p>Problem happens when I try to use the serviceworker, that is waiting for the ready event:</p>
  
  <pre><code>// Inside of file.js
  navigator.serviceWorker.ready.then(...) // Will not fire
  </code></pre>
  
  <p>I guess of whats happening is that the ready event is not firing becouse the serviceworker "thinks" it is beeing installed from a subfolder named "MyApp", but when the file.js runs and tries to use the serviceworker, it looks like the file.js is served from root, and thus outside the scope of the serviceworker.</p>
  
  <p>Any ideas on how to handle this? I tried using the scope parameter, but I think that is only use to limit the scope, not expand it. </p>
  
  <pre><code>{ scope: '/' } // Will fail with outside root error
  { scope: '/MyApp' } // Works, but still no ready event
  </code></pre>
  
  <p>I'm sure I'm missing something here, but I've no idea what it is.</p>