-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[Feature] Target interception #13112
Comments
If your use case is response interception/modification, does https://playwright.dev/docs/network#modify-responses work for you? |
Unfortunately it doesn't, as it uses Node.js HTTP API under the hood - this disables HTTP/2 - the behavior isn't the same.
|
Can you tell us more about your use case and where it fails with the current implementation but works with
We added that method during the first iteration on this feature but then moved away from it due to some technical issues. What we could do currently is to (optionally) use http2 instead of https but I'm not sure if that would address your problem given the requirements you mentioned above, we need to better understand your scenario. |
Automation. Some websites reject requests if the fingerprint doesn't match real browsers.
We've developed an npm package that tries to mimic the browser behavior, so we could use that instead. However that's not the best solution. Target interception would also enable adding init scripts dynamically - this is not limited to response interception. E.g. different pages would have slightly different scripts. |
FYI target interception is currently blocked by https://crbug.com/1070568 |
Why was this issue closed?Thank you for your involvement. This issue was closed due to limited engagement (upvotes/activity), lack of recent activity, and insufficient actionability. To maintain a manageable database, we prioritize issues based on these factors. If you disagree with this closure, please open a new issue and reference this one. More support or clarity on its necessity may prompt a review. Your understanding and cooperation are appreciated. |
Previous issue: #1101
Related: #13111
There is
context.addInitScript
, however it doesn't solve all cases where target interception is needed.For example, if there are CDP messages to be sent. I'm using CDP for response interception, which cannot be done via Playwright yet.
In my opinion, there should be a way to intercept target creation, so Node.js code can be executed (and that enables a wide array of other possibilities) before webpage scripts are ran.
The text was updated successfully, but these errors were encountered: