title: Firefox: Service Worker: SecurityError: DOMException: The Operation is insecure
body: <p>In <code>app.js</code>, 
  I am checking the serviceWorker existence in navigator object and if available then registering the SW.</p>
  
  <pre><code>if ('serviceWorker' in navigator) {
      navigator.serviceWorker.register('./service-worker.js', { scope: './' })
          .then(function(registration) {
              console.log("Service Worker Registered!");
          }).catch(function(err) {
              console.log("Service Worker not registered!", err);
          });
  }
  </code></pre>
  
  <p>When trying to register SW, I receive the below error in Firefox. I also made sure the <code>service-worker.js</code> file is under <em>src</em> directory. </p>
  
  <p><a href="https://i.stack.imgur.com/MX7Mu.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/MX7Mu.jpg" alt="enter image description here"></a></p>
  
  <p>Checking my <a href="http://about:config" rel="noreferrer">about:config</a> in Firefox (version 59.0.2) I had service worker and storage api enabled. So that shouldn't be an issue.</p>
  
  <p><a href="https://i.stack.imgur.com/dM6gV.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/dM6gV.jpg" alt="enter image description here"></a><a href="https://i.stack.imgur.com/rliyj.png" rel="noreferrer"><img src="https://i.stack.imgur.com/rliyj.png" alt="enter image description here"></a></p>
  
  <p>PS: The same code works fine on Chrome.</p>