Open iustinpericica opened 2 weeks ago
Thanks for the repro! This is interesting. It seems to work fine for Webkit and Firefox, but not for Chromium:
❯ npx playwright test
Running 3 tests using 3 workers
[chromium] › example.spec.ts:3:5 › has title
Intercepted: http://localhost:3000/browser-sync/socket.io/?EIO=4&transport=polling&t=P6TgL9K&sid=ZmkUOqVAdPgLLx8bAAAC
Intercepted: http://localhost:3000/browser-sync/socket.io/?EIO=4&transport=polling&t=P6TgL9N&sid=ZmkUOqVAdPgLLx8bAAAC
Intercepted: https://jsonplaceholder.typicode.com/posts/1
[webkit] › example.spec.ts:3:5 › has title
Intercepted: http://localhost:3000/browser-sync/socket.io/?EIO=4&transport=polling&t=P6TgLGo&sid=pFuMyW7mZ9rfbhbRAAAE
Intercepted: http://localhost:3000/browser-sync/socket.io/?EIO=4&transport=polling&t=P6TgLGq&sid=pFuMyW7mZ9rfbhbRAAAE
Intercepted: https://jsonplaceholder.typicode.com/posts/1
Intercepted: https://jsonplaceholder.typicode.com/todos/1
Intercepted: https://jsonplaceholder.typicode.com/todos/1
[firefox] › example.spec.ts:3:5 › has title
Intercepted: http://localhost:3000/browser-sync/socket.io/?EIO=4&transport=polling&t=P6TgLhL&sid=AGDaVChmvMU86TeiAAAG
Intercepted: http://localhost:3000/browser-sync/socket.io/?EIO=4&transport=polling&t=P6TgLhL.0&sid=AGDaVChmvMU86TeiAAAG
Intercepted: https://jsonplaceholder.typicode.com/posts/1
Intercepted: https://jsonplaceholder.typicode.com/todos/1
Intercepted: https://jsonplaceholder.typicode.com/todos/1
3 passed (4.0s)
This looks very similar to https://github.com/microsoft/playwright/issues/4487. @yury-s could you take a look?
There is a bug in Chromium, when interception is enabled after the worker has been created, the worker requests are not properly intercepted. As a workaround you can call page.route
earlier.
Filed upstream issue https://issues.chromium.org/u/1/issues/364987731
Version
1.43.1
Steps to reproduce
await page.route("**/*", route => { console.log("Intercepted:", route.request().url()); return route.continue(); });
at the beggining of the testOr see the repro repo I created - https://github.com/iustinpericica/repro_pw_web_workers
Expected behavior
I would expect to see those web worker requests.
Actual behavior
I can not see web worker requests.
Additional context
No response
Environment