title: Server worker being registered twice
body: <p>I'm using FCM web notification service, when I am calling the register function:</p>
  <pre><code>if ('serviceWorker' in navigator) {
           window.addEventListener('load', function() {
          navigator.serviceWorker.register('/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>The service worker is registered twice, one because of this function, and one by the <a href="https://www.gstatic.com/firebasejs/3.5.2/firebase-messaging.js" rel="nofollow noreferrer">FCM script</a>. This is my service worker code:</p>
  <pre><code>importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-app.js');
  importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-messaging.js');
  
      'messagingSenderId': '&lt;my senderid&gt;'
  });
  
  const messaging = firebase.messaging();
  
  
  messaging.setBackgroundMessageHandler(function (payload) {
     
      
      self.addEventListener('notificationclick', function (event) {
          event.notification.close();
  
          var promise = new Promise(function (resolve) {
              setTimeout(resolve, 1000);
          }).then(function () {
              return clients.openWindow(payload.data.locator);
          });
  
          event.waitUntil(promise);
      });
     
      var notificationTitle = payload.data.title;
      var notificationOptions = {
          body: payload.data.body,
          icon: payload.data.icon
      };
      return self.registration.showNotification(notificationTitle,
          notificationOptions);
  });
  </code></pre>
  <p>One more thing, when I send test notifications, and I click the first message and it opens the URL correctly, but in the same instance of Chrome, all other messages I click open the URL of the first message. This problem does not happen on Firefox, just Chrome. I am using chrome version 55</p>