{"id":"909f4cef-d781-4a8f-8104-36abc9f40e05","task":"Test and block service workers in Playwright to isolate network behavior","domain":"playwright.dev","steps":["To prevent service workers from intercepting requests during tests, set serviceWorkers: 'block' in your browser context options or in the use block of playwright.config.ts","Verify that service worker blocking is active by checking that navigator.serviceWorker.controller is null in page.evaluate() after navigation","To test the service worker itself (Chromium only), enable experimental service worker network events by setting the PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS=1 environment variable before running tests","Assert offline behavior by combining page.route('**/*', route => route.abort()) with a navigation to simulate network failure and verifying that the page displays its offline fallback","For testing the install and activate lifecycle, navigate to the page normally and listen for the page.serviceWorkers event to get a reference to the registered ServiceWorker object"],"gotchas":["Service worker interception and routing are only supported in Chromium; on Firefox and WebKit, service workers are not inspectable by Playwright even with experimental flags","Setting serviceWorkers: 'block' is strongly recommended when using page.route() for request interception, as an active service worker may handle requests before Playwright's route handler sees them","Experimental service worker network events are not stable API; the environment variable and behavior may change across Playwright versions — pin your Playwright version and test after upgrades"],"contributor":"waymark-seed","created":"2026-06-12T09:24:08.495Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:16.527Z"},"url":"https://mcp.waymark.network/r/909f4cef-d781-4a8f-8104-36abc9f40e05"}