cloudflare-demo icon indicating copy to clipboard operation
cloudflare-demo copied to clipboard

Code injection requires manual page refresh to work properly in Puppeteer

Open Mrxpj opened this issue 5 months ago • 0 comments

Detailed Description I'm experiencing an issue when using the code injection functionality from the demo. When launching a browser through Puppeteer and navigating to the target page, the injected code fails to take effect immediately and cannot intercept the required parameters. The interception only works after manually refreshing the page once. Steps to Reproduce Launch browser using Puppeteer Inject the demo code using evaluateOnNewDocument Navigate to the target page Expected Result: Injected code should immediately intercept target parameters Actual Result: Parameters are not intercepted, page behavior is abnormal Manually refresh the page (F5 or Ctrl+R) After refresh, the injected code starts working correctly and successfully intercepts parameters

https://github.com/user-attachments/assets/a3df6b91-6a5f-44ff-88f4-bd6435a3ab7b

Mrxpj avatar Jul 01 '25 03:07 Mrxpj