title: ServiceWorker: The script has an unsupported MIME type (chrome-extension)
body: <pre><code>The script has an unsupported MIME type ('text/plain').
  Failed to load resource: net::ERR_INSECURE_RESPONSE  
  ServiceWorker registration failed:  DOMException: Failed to register a 
  ServiceWorker: The script has an unsupported MIME type ('text/plain').
  </code></pre>
  
  <p>Error log.</p>
  
  <pre><code>if ('serviceWorker' in navigator) {
  window.addEventListener('load', function() {
      navigator.serviceWorker.register("/scripts/sw.js").then(function(registration) {
          // Registration was successful
          console.log('ServiceWorker registration successful with scope: ', registration.scope);
      }).catch(function(err) {
          // registration failed :(
          console.log('ServiceWorker registration failed: ', err);
      });
  });
  </code></pre>
  
  <p>I tried to use a service worker in chrome-extension, but this error occurred. I couldn't find a solution, so I asked. Thank you very much.</p>