title: Chrome & Firebase Push Notifications service worker not ready
body: <p>In following this Code Lab:
  <a href="https://developers.google.com/web/fundamentals/getting-started/codelabs/push-notifications/" rel="nofollow noreferrer">https://developers.google.com/web/fundamentals/getting-started/codelabs/push-notifications/</a></p>
  
  <p>I downloaded the <code>push-notifications.git</code> project and uploaded the final <code>/completed/08-unsubscribe</code> example to my HTTPS web server.</p>
  
  <p>When I visit this page for the first time, the console log reads:</p>
  
  <pre><code>Service Worker is supported
  sw.js:24 Started
  sw.js:28 Installed
  sw.js:32 Activated
  </code></pre>
  
  <p>Visiting the page a second time reads:</p>
  
  <pre><code>Service Worker is supported
  </code></pre>
  
  <p>The issue I'm trying to debug is that I'm not getting a <code>Service Worker is ready</code> output from this function:</p>
  
  <pre><code>if ('serviceWorker' in navigator) {
    console.log('Service Worker is supported');
    navigator.serviceWorker.register('/sw.js').then(function() {
      return navigator.serviceWorker.ready;
    }).then(function(serviceWorkerRegistration) {
      reg = serviceWorkerRegistration;
      subscribeButton.disabled = false;
      console.log('Service Worker is ready :^)', reg);
    }).catch(function(error) {
      console.log('Service Worker Error :^(', error);
    });
  }
  </code></pre>
  
  <p>Where is the hangup in preventing my Subscribe button from becoming enabled and firing either the <code>console.log('Service Worker is ready :^)', reg);</code> or <code>console.log('Service Worker Error :^(', error);</code> messages?</p>