# Test a PWA

> How to test a PWA's installability and service worker in Chrome DevTools: inspecting the manifest, simulating offline, and forcing a worker update.

**In one line:** Chrome DevTools' Application panel lets you inspect, modify, and debug
web app manifests, service workers, and service worker caches — the manifest's Installability
section flags what is blocking installation, and the Service Workers tab's Offline checkbox
lets you simulate offline conditions without disconnecting your machine.

## 1. Inspect the manifest

Open DevTools' Application panel and select the Manifest tab. It shows the Identity and
Presentation fields from your manifest source in a more readable form, the icons you have
declared, and any registered shortcuts and screenshots. Per Chrome for Developers, if DevTools
encounters an error — such as an icon that cannot be loaded — the Manifest tab displays an
Installability section describing the error.

When you trigger installation from the address bar's Install button, keep the Console drawer
open: per Chrome for Developers, the Console reports issues with your manifest and logs other
information about the installation process.

```json
{
  "name": "Example PWA",
  "start_url": "/",
  "display": "standalone",
  "icons": [{ "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" }]
}
```

## 2. Where this tooling is supported

The Application panel's Manifest and Service Workers tabs described here are a Chrome
DevTools feature. For the underlying APIs' own browser support — independent of which
devtools you use to inspect them — see the
[Service Workers](/compatibility/service-worker/) compatibility table on this site.

## 3. Test the service worker with the Service Workers tab

If a service worker is installed for the currently open page, it is listed on the Service
Workers tab. From there, per Chrome for Developers:

- The **Offline** checkbox puts DevTools into offline mode, equivalent to the offline mode
  available from the Network panel.
- The **Update on reload** checkbox forces the service worker to update on every page load.
- The **Bypass for network** checkbox bypasses the service worker and forces the browser to
  go to the network for requested resources.
- The **Push** button emulates a push notification without a payload, and the **Sync** button
  emulates a background sync event.
- Explicitly stopping the service worker with the **stop** link simulates the browser
  stopping it, which Chrome for Developers notes "frequently reveals bugs due to faulty
  assumptions about persistent global state."

## 4. Detect whether a service worker is registered for the page

Per MDN, `navigator.serviceWorker` is undefined in browsers that lack Service Worker support,
and `ServiceWorkerContainer.getRegistration()` resolves with `undefined` when no registration
is found for the given scope. Checking both before assuming a registration exists keeps the
test from throwing in a browser that lacks the API:

```js
async function isPwaTestable() {
  if (!('serviceWorker' in navigator)) {
    return { testable: false, reason: 'Service workers are not supported in this browser.' };
  }
  const registration = await navigator.serviceWorker.getRegistration();
  if (!registration) {
    return { testable: false, reason: 'No service worker is registered for this page yet.' };
  }
  return { testable: true, registration };
}
```

## Practical checklist

- PWA-specific auditing in Lighthouse is deprecated: Chrome for Developers' own docs carry
  the notice "PWA testing in Lighthouse is deprecated," and point instead to Chrome's
  installability criteria and the DevTools Application panel for current guidance — do not
  rely on a Lighthouse PWA score as your test.
- The **Install app** / **Add to home screen** entry point in desktop Chrome cannot simulate
  the mobile install workflow; per Chrome for Developers, testing the genuine mobile
  experience requires a real device connected over remote debugging.
- Stopping a service worker from the Service Workers tab is a deliberate way to exercise
  restart behavior — do it before shipping, since production browsers stop and restart
  service workers on their own schedule, not just when you reload the page.
- The **Update Cycle** table on the Service Workers tab shows the service worker's activities
  and their elapsed times, such as install, wait, and activate.

## Where to go next

See [What a service worker is, and the smallest one that works](/reference/service-worker/)
for what the Update Cycle table in the Service Workers tab is measuring, and
[Service Workers](/compatibility/service-worker/) for browser support of the API this
guide's tests exercise.