Chrome and Edge DevTools
Open DevTools, then the Application panel:
- Manifest: shows parsed fields, icon previews, the computed
id, and install warnings. Start here if the install button does not appear. - Service workers: status of each version, with buttons to Update, Unregister, push a test message, or trigger a sync. Tick Update on reload while developing so every reload installs the newest
sw.js. Bypass for network skips the worker entirely. - Storage: shows usage, and Clear site data wipes caches, IndexedDB, cookies and the registration in one click.
- Cache storage: browse every cache and entry; right-click to delete.
- Background services: record push, sync, background fetch and notification events, even while DevTools is closed.
In the Network panel, responses served by the worker show "(ServiceWorker)" in the Size column, and the Offline checkbox simulates no connection. chrome://serviceworker-internals and edge://serviceworker-internals list every registration in the browser.
To debug the worker itself, pick its context in the console drop-down, or open chrome://inspect/#service-workers.
Firefox
about:debugging#/runtime/this-firefox lists service workers with Inspect, Push and Unregister. The Storage panel in DevTools shows Cache Storage and IndexedDB. Firefox for Android can be debugged from desktop over USB the same way.
Safari
Enable Show features for web developers in Safari settings, then use Develop > Service Workers to inspect each one. To debug a Home Screen web app on an iPhone or iPad, connect it to a Mac with a cable, enable Web Inspector on the device (Settings > Apps > Safari > Advanced), and pick the app under the device's name in the Develop menu.
Android devices
Connect the phone with USB debugging enabled and open chrome://inspect on your computer. Installed PWAs appear as their own targets.
Common problems and fixes
| Problem | Likely cause | Fix |
|---|---|---|
| Changes do not show up | Old worker still active; new one waiting | Close all tabs, or use an update prompt. In development, tick Update on reload. |
| Worker never updates | sw.js cached by a CDN or browser | Serve sw.js with Cache-Control: no-cache; check your CDN rules. |
addAll fails on install | One precached URL returned 404 or a redirect | Check every URL; addAll fails if any request fails. |
| Offline shows the browser error | Navigation request not handled, or the offline page is not cached | Handle request.mode === 'navigate' and precache the offline page. |
| Pages work but images are missing offline | Images not cached | Add a runtime cache for images. |
| Scope error on register | Worker file is in a sub-folder | Move sw.js to the root, or send Service-Worker-Allowed. |
| Works on localhost, not in production | Not HTTPS, or wrong MIME type | Serve over HTTPS with Content-Type: application/javascript. |
| Logged-in users see someone else's page | Personalised HTML cached | Never cache personalised responses with a shared key. |
A clean slate
// Paste in the page's console to remove every registration and cache for this origin
(async () => {
for (const r of await navigator.serviceWorker.getRegistrations()) await r.unregister();
for (const k of await caches.keys()) await caches.delete(k);
location.reload();
})();