title: FirebaseError : We are unable to register the default service worker
body: <p>I am using FCM web app notification for send notification to browser.My code below.</p>
  <pre><code>var config = {
      apiKey: &quot;&lt;API-KEY&gt;&quot;,
      authDomain: &quot;&lt;AUTH-DOMAIN&gt;.firebaseapp.com&quot;,
      databaseURL: &quot;&lt;DATABASE&gt;.firebaseio.com&quot;,
      storageBucket: &quot;&lt;BUCKET&gt;.appspot.com&quot;,
      messagingSenderId: &quot;&lt;SENDERID&gt;&quot;,
    };
    firebase.initializeApp(config);
  
  const messaging = firebase.messaging();
      messaging.requestPermission()
              .then(function(){
                  console.log(&quot;GRANTED&quot;);
                  console.log(messaging.getToken());
                  return messaging.getToken();
              })
              .then(function(token){
                  console.log(token);
              })
              .catch(function(err){
                  console.log('Error Occurred.' + err)
              });
  
  messaging.setBackgroundMessageHandler(function(payload){
    const title = &quot;Hello World&quot;;
    const option = { body: payload.data.status }
    return self.registration.showNotification(title,option);
  });
  </code></pre>
  <p>It is working fine and generating token on the chrome's localhost server  but  not working on my hosting server.</p>
  <p>I got the following error with my hosting server.</p>
  <p><strong>Error Occurred.FirebaseError: Messaging: We are unable to register the default service worker. The operation is insecure. (messaging/failed-serviceworker-registration).</strong></p>
  <p>Please guide me if anybody have any idea about this.</p>