Closed TimRecktenwald closed 1 week ago
Thanks for such a detailed report. I will take a look once I have a bit more time.
📣 I just released a new version of rebrowser-patches
with a completely new fix for Runtime.Enable leak.
This fix doesn't lose access to main context and also works in workers 🎉
It's a complete drop-in replacement, so you don't need to change any of your existing code.
Please try your code with new version.
Thanks for this. Will there be a version of Playwright as well?
@cvhoang yes, probably next week
@nwebson The "addBinding" approach solved the issue, thank you very much! :) Maybe you should consider adding a note to the "enableDisable" approach section in the README regarding this bug, though.
I encountered an issue where the HTML document of a page is empty for some websites when using the "enableDisable" approach. I was able to consistently reproduce the issue for some websites like YouTube with the small code snippet below. I also included a short video showing the problem. It should be noted that most websites work totally fine, but others (including YouTube and a specific registration page of the Japanese website www.cmoa.jp) exhibit this behavior.
When executing the script as-is, it outputs
<html><head></head><body></body></html>
to the console. When changing the environment variable in the first line to "0" (i.e., disabling the patches), it logs the entire HTML document normally. I tried both the chromeLauncher and Puppeteer's built-in "launch()" method, which does not seem to make a difference.I want to use the "enableDisable" approach since I have an existing tool to which I want to apply your patches (which I think are awesome!). Using the "alwaysIsolated" approach would involve more changes to circumvent the restrictions, thus, I did not test the behavior in that mode yet.
Node version: 18.17.1 Puppeteer version: 23.3.1
Code to reproduce the issue:
https://github.com/user-attachments/assets/2eff088a-f74d-4318-9a3e-4a6a6b2054f1