I have a very simple sample using the new Service Worker (Progressive Web Apps) -- see more at https://developers.google.com/web/fundamentals/getting-started/primers/service-workers
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:
1. Use the following URL (from your Google Chrome web browser) and the Plunkr editor will appear : https://plnkr.co/edit/FgG2krKDuSmIddR1Pskd?p=preview
Here's the code from the ServiceWorker.js which should display the fetch statments in the console.
//serviceWorker.js
console.log("well, I'm in serviceWorker.js");
self.addEventListener("fetch", function(event) {
console.log("Fetch request for:", event.request.url);
});
2. Once you get there, open up the Chrome dev console (so you can see the output) - HINT: Pressing F12 in Chrome should open your console.
Run the plunkr. You should see output like the following:
The Failure
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.
Things I've Tried
- Stopping and restarting IIS Express
- changing to the Chrome Dev tools Application tab and force an Update (see next image)
- changing to the Chrome Dev tools Application tab and force an Unregistered to run again and re-register (see next image)
In Chrome you will never see the console updated with the fetch items.
4. Run Locally In Firefox
However, I ran the same code in FireFox and that console does show the fetch items:

EDIT
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).







