Playwright · Senior · Question 17 of 77
Why might page.route not catch some requests?
- 1A service worker can handle them before the network
- 2Routes stop working after the first navigation
- 3Routes only work for requests made by images
Show the answer
Correct answer: A service worker can handle them before the network
Explanation
Requests served by a service worker bypass page.route. Setting serviceWorkers: 'block' makes routing predictable.