title: Chrome extension: Serviceworker cross origin failing
body: <p><a href="https://developer.chrome.com/extensions/xhr#requesting-permission" rel="nofollow noreferrer">Docs</a> claim that:</p>
  
  <blockquote>
    <p>By adding hosts or host match patterns (or both) to the permissions section of the manifest file, the extension can request access to remote servers outside of its origin</p>
  </blockquote>
  
  <p>My &Lt;manifest.json&Gt;:</p>
  
  <pre><code>{"manifest_version":2,"name":"","version":"0","permissions":["http://example.org/"],"background":{"scripts":["asd"]}}
  </code></pre>
  
  <p>&Lt;asd&Gt;:</p>
  
  <pre><code>navigator.serviceWorker.register('sdf.js',{scope:'http://example.org/'}).then(x=&gt;console.log('done', x))
  </code></pre>
  
  <p>&Lt;sdf.js&Gt;:</p>
  
  <pre><code>addEventListener('fetch', e=&gt; e.respondWith(new Response('url: '+e.request.url,{headers:{'content-type':'text/html'/*, etc*/}})))
  </code></pre>
  
  <p>I loaded the code using &Lt;Load unpacked extension&Gt;; It crashed without any error message:</p>
  
  <p><a href="https://i.stack.imgur.com/kUFxf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kUFxf.png" alt="enter image description here"></a></p>
  
  <p>Apparently the code <code>"permissions":["http://example.org/"]</code> crashed the extension.</p>
  
  <p>How to set permissions for Chrome Extension cross-origin serviceworker? Is there a required Chrome flag?</p>