title: Why doesn't Service Worker seem to write to the console in Google Chrome when run on localhost?
body: <p>I have a very simple sample using the new Service Worker (Progressive Web Apps) -- see more at <a href="https://developers.google.com/web/fundamentals/getting-started/primers/service-workers" rel="noreferrer">https://developers.google.com/web/fundamentals/getting-started/primers/service-workers</a></p>
  
  <p>The sample seems to fail to write on console.log() when I run my app from my localhost.  However, it does work in a plunkr I created.  Here are the steps for running it at plunkr:</p>
  
  <p><strong>1.</strong> Use the following URL (from your Google Chrome web browser) and the Plunkr editor will appear : <a href="https://plnkr.co/edit/FgG2krKDuSmIddR1Pskd?p=preview" rel="noreferrer">https://plnkr.co/edit/FgG2krKDuSmIddR1Pskd?p=preview</a></p>
  
  <p>Here's the code from the ServiceWorker.js which should display the fetch statments in the console.</p>
  
  <pre><code>//serviceWorker.js
  
  console.log("well, I'm in serviceWorker.js");
  self.addEventListener("fetch", function(event) {
    console.log("Fetch request for:", event.request.url);
  });
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/kbPtl.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kbPtl.png" alt="plunkr first view"></a></p>
  
  <p><strong>2.</strong> Once you get there, open up the Chrome dev console (so you can see the output) - <strong>HINT</strong>: Pressing <em>F12</em> in Chrome should open your console.</p>
  
  <p>Run the plunkr.  You should see output like the following:</p>
  
  <p><a href="https://i.stack.imgur.com/3GMiS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3GMiS.png" alt="console output"></a></p>
  
  <p><strong>The Failure</strong></p>
  
  <p>When I run this same code locally (on localhost running IISExpress), I do not see the fetch statements output to the console. (This is the code in the ServiceWorker.js file)
  I only see the initial registration.</p>
  
  <p>It looks like:
  <a href="https://i.stack.imgur.com/v5pwh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/v5pwh.png" alt="service worker registered"></a></p>
  
  <p><strong>Things I've Tried</strong></p>
  
  <ol>
  <li>Stopping and restarting IIS Express</li>
  <li>changing to the Chrome Dev tools Application tab and force an Update (see next image)</li>
  <li>changing to the Chrome Dev tools Application tab and force an Unregistered to run again and re-register (see next image)</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/hJpUs.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hJpUs.png" alt="update and unregister"></a></p>
  
  <p>In Chrome you will never see the console updated with the fetch items.</p>
  
  <p><strong>4. Run Locally In Firefox</strong></p>
  
  <p>However, I ran the same code in FireFox and that console does show the fetch items:
  <a href="https://i.stack.imgur.com/bhhTR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bhhTR.png" alt="firefox console"></a></p>
  
  <p><strong>EDIT</strong> 
  Someone asked if this problem occurs because of a Console.log filter so here's a snapshot showing there are no filters on and all console.log entries are indeed shown.  This is numerous runs (reloads of the page).
  <a href="https://i.stack.imgur.com/tQxYx.png" rel="noreferrer"><img src="https://i.stack.imgur.com/tQxYx.png" alt="no console filter"></a></p>