Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Page.route does not intercept web worker requests #32355

Closed
iustinpericica opened this issue Aug 28, 2024 · 7 comments · Fixed by #32965
Closed

[Bug]: Page.route does not intercept web worker requests #32355

iustinpericica opened this issue Aug 28, 2024 · 7 comments · Fixed by #32965

Comments

@iustinpericica
Copy link
Member

iustinpericica commented Aug 28, 2024

Version

1.43.1

Steps to reproduce

  1. Have a web application with few web workers that performs http requests
  2. Add await page.route("**/*", route => { console.log("Intercepted:", route.request().url()); return route.continue(); }); at the beggining of the test
  3. Http requests initiated by web workers are not catched

Or 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

Windows, Browser Tests
@iustinpericica
Copy link
Member Author

@Skn0tt
Copy link
Member

Skn0tt commented Aug 29, 2024

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 #4487. @yury-s could you take a look?

@yury-s
Copy link
Member

yury-s commented Sep 6, 2024

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.

@yury-s yury-s added the v1.48 label Sep 6, 2024
@yury-s
Copy link
Member

yury-s commented Sep 6, 2024

Filed upstream issue https://issues.chromium.org/u/1/issues/364987731

@yury-s yury-s assigned dgozman and unassigned yury-s Sep 6, 2024
yury-s added a commit that referenced this issue Sep 6, 2024
@dgozman
Copy link
Contributor

dgozman commented Sep 20, 2024

@dgozman
Copy link
Contributor

dgozman commented Sep 26, 2024

Upstream fix landed, merged to 130, hopefully gets into the next Chromium roll.

@andermoranPro
Copy link

@dgozman is there a way for us to have a guess on the fix being available. Not looking for an exact date but a time frame hopefully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants