“Status Code:200 OK (from ServiceWorker)” in Chrome Network DevTools?

This is a common source of confusion, so I wanted to go into a bit more detail. I have a full working demo in this Gist, and you can view a live version of it thanks to RawGit. Here’s the relevant portion of the service worker code inline, for illustrative purposes: self.addEventListener(‘fetch’, event => { … Read more

Can you use a service worker with a self-signed certificate?

As an alternative to using self-signed certificates, you can launch Chrome or Firefox such that it pretends certain domains are secure. For example, using Chrome on a Mac, you can launch it using: /Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ –user-data-dir=/tmp/foo –unsafely-treat-insecure-origin-as-secure=http://www.your.site Service workers should then work from http://www.your.site. More info can be found here: Options for testing … Read more

Options for testing service workers via HTTP

In general, you need to serve both your page and your service worker script via HTTPS in order to use service workers. The rationale is described at Prefer Secure Origins For Powerful New Features. There’s an exception to the HTTPS requirement in place to facilitate local development: if you access your page and service worker … Read more

How do I uninstall a Service Worker?

Removing Service Workers Programmatically You can remove service workers programmatically like this: navigator.serviceWorker.getRegistrations().then(function(registrations) { for(let registration of registrations) { registration.unregister() } }) Docs: getRegistrations, unregister Removing Service Workers Through The User Interface You can also remove service workers under the Application tab in Chrome Devtools.

Service worker JavaScript update frequency (every 24 hours?)

Note: As of Firefox 57, and Chrome 68, as well as the versions of Safari and Edge that support service workers, the default behavior has changed to account for the updated service worker specification. In those browsers, HTTP cache directives will, by default, be ignored when checking the service worker script for updates. The description … Read more

What limitations apply to opaque responses?

Access to Opaque Responses’ Headers / Body The most straightforward limitation around opaque responses is that you cannot get meaningful information back from most of the properties of the Response class, like headers, or call the various methods that make up the Body interface, like json() or text(). This is in keeping with the black-box … Read more