Skip to content
Learn Measure Blog Case studies About
On this page
  • Browser compatibility
  • How the Lighthouse service worker audit fails
  • How to register a service worker
  • Resources

Does not register a service worker that controls page and start_url

May 4, 2019 — Updated Jun 10, 2020
Available in: Español, 日本語, 한국어, Português, Русский, 中文, English
Appears in: PWA audits
On this page
  • Browser compatibility
  • How the Lighthouse service worker audit fails
  • How to register a service worker
  • Resources

Registering a service worker is the first step towards enabling key Progressive Web App (PWA) features:

  • Works offline
  • Supports push notifications
  • Can be installed to the device

Learn more in the Service workers and the Cache Storage API post.

Browser compatibility #

All major browsers except Internet Explorer support service workers. See Browser compatibility.

How the Lighthouse service worker audit fails #

Lighthouse flags pages that don't register a service worker:

Lighthouse audit showing site doesn't register a service worker

Lighthouse checks if the Chrome Remote Debugging Protocol returns a service worker version. If it doesn't, the audit fails.

In the Lighthouse report UI the full PWA badge is given when you pass all of the audits in all of the PWA subcategories (Fast and reliable, Installable, and PWA optimized).

How to register a service worker #

Success

Workbox is the recommended approach for adding service workers to websites because it automates a lot of boilerplate, makes it easier to follow best practices, and prevents subtle bugs that are common when using the low-level ServiceWorker API directly.

Registering a service worker involves only a few lines of code, but the only reason you'd use a service worker is to make it possible to implement one of the PWA features outlined above. Actually implementing those features requires more work:

  • To learn how to cache files for offline use, see the What is network reliability and how do you measure it? post.
  • To learn how to make your app installable, see the Make it installable codelab.
  • To learn how to enable push notifications, see Google's Adding Push Notifications to a Web App.

Resources #

  • Source code for Does not register a service worker that controls page and start_url audit
  • Service Workers: an Introduction
  • Service workers and the Cache Storage API
  • What is network reliability and how do you measure it?
  • Make it installable
  • Adding Push Notifications to a Web App
Last updated: Jun 10, 2020 — Improve article
Return to all articles
Share
subscribe

Contribute

  • File a bug
  • View source

Related content

  • developer.chrome.com
  • Chrome updates
  • Web Fundamentals
  • Case studies
  • Podcasts
  • Shows

Connect

  • Twitter
  • YouTube
  • Google Developers
  • Chrome
  • Firebase
  • Google Cloud Platform
  • All products
  • Terms & Privacy
  • Community Guidelines

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies.