title: AbortError: Failed to register a ServiceWorker: ServiceWorker cannot be started
body: <p>I am trying to test push notifications functionality in Chrome. I cloned the sample Chrome push notification web-app provided by Google here: <a href="https://github.com/GoogleChrome/samples/tree/gh-pages/push-messaging-and-notifications" rel="nofollow noreferrer">https://github.com/GoogleChrome/samples/tree/gh-pages/push-messaging-and-notifications</a> </p>
  
  <p>The code is working properly when I hosted the web app using <a href="https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb?hl=en" rel="nofollow noreferrer"><code>Web server for Chrome extension</code></a> HTTP server on localhost. When I wanted to test the web-app on a mobile device, I couldn't use the Web server for Chrome extension because of the fact that it is a HTTP server and other than localhost, service workers only work on HTTPS. So I created a python based HTTPS server using a self signed certificate and hosted the web-app there.</p>
  
  <p>Now I am getting <code>AbortError: Failed to register a ServiceWorker: ServiceWorker cannot be started</code> 
  while registering the service worker like below:</p>
  
  <pre><code>    navigator.serviceWorker.register('./service-worker.js')
  </code></pre>
  
  <p>The service-worker.js is in the same directory as the html file as well as the js file from where i am calling this method. </p>
  
  <p>There's not much documentation on service workers. Also the error is too vague to figure out anything. Please help me in figuring out the root cause of this error.</p>