Open monkekode opened 2 years ago
Looks like this happens on sites owned by google: google.com, youtube.com, but not on facebook.com, microsoft.com.
I can reproduce.
Fix is pushed & cherry-picked to 1.17, but maybe we need a better solution later.
Debugging observations: it is only reproducible in headful and when response interception is on. We receive two Fetch.requestPaused events for the same request and get stuck waiting for request extra info for the second one:
pw:protocol ◀ RECV {"method":"Fetch.requestPaused","params":{"requestId":"interception-job-1.1","request":{"url":"https://www.google.com/","method":"GET","headers":{"Upgrade-Insecure-Requests":"1","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4744.0 Safari/537.36","Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","sec-ch-ua":"\"(Not(A:Brand\";v=\"8\", \"Chromium\";v=\"98\"","sec-ch-ua-mobile":"?0","sec-ch-ua-platform":"\"macOS\""},"initialPriority":"VeryHigh","referrerPolicy":"strict-origin-when-cross-origin"},"frameId":"197072FB470F30BEA2C9C66F19E7BF20","resourceType":"Document","networkId":"0D10331B4121BC1248597649CF3FF5AA"},"sessionId":"E9134B4B5CFD25CA8EBB016F9C97E3E7"} +0ms
requestId = 0D10331B4121BC1248597649CF3FF5AA requestWillBeSentEvent = [object Object]
pw:protocol SEND ► {"id":25,"method":"Fetch.continueRequest","params":{"requestId":"interception-job-1.1"},"sessionId":"E9134B4B5CFD25CA8EBB016F9C97E3E7"} +2ms
pw:protocol ◀ RECV {"id":25,"result":{},"sessionId":"E9134B4B5CFD25CA8EBB016F9C97E3E7"} +1ms
pw:protocol ◀ RECV {"method":"Page.lifecycleEvent","params":{"frameId":"197072FB470F30BEA2C9C66F19E7BF20","loaderId":"C6B7285CC5665B28080042D55A9AB01B","name":"networkAlmostIdle","timestamp":155310.035678},"sessionId":"E9134B4B5CFD25CA8EBB016F9C97E3E7"} +218ms
pw:protocol ◀ RECV {"method":"Page.lifecycleEvent","params":{"frameId":"197072FB470F30BEA2C9C66F19E7BF20","loaderId":"C6B7285CC5665B28080042D55A9AB01B","name":"networkIdle","timestamp":155310.035678},"sessionId":"E9134B4B5CFD25CA8EBB016F9C97E3E7"} +0ms
pw:protocol ◀ RECV {"method":"Fetch.requestPaused","params":{"requestId":"interception-job-2.0","request":{"url":"https://www.google.com/","method":"GET","headers":{"Upgrade-Insecure-Requests":"1","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4744.0 Safari/537.36","Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","sec-ch-ua":"\"(Not(A:Brand\";v=\"8\", \"Chromium\";v=\"98\"","sec-ch-ua-mobile":"?0","sec-ch-ua-platform":"\"macOS\"","sec-ch-ua-full-version":"\"98.0.4744.0\"","sec-ch-ua-arch":"\"x86\"","sec-ch-ua-platform-version":"\"10.15.7\"","sec-ch-ua-model":"\"\""},"initialPriority":"VeryHigh","referrerPolicy":"strict-origin-when-cross-origin"},"frameId":"197072FB470F30BEA2C9C66F19E7BF20","resourceType":"Document","networkId":"0D10331B4121BC1248597649CF3FF5AA"},"sessionId":"E9134B4B5CFD25CA8EBB016F9C97E3E7"} +0ms
requestId = 0D10331B4121BC1248597649CF3FF5AA requestWillBeSentEvent = undefined
pw:protocol SEND ► {"id":26,"method":"Target.disposeBrowserContext","params":{"browserContextId":"9EABA17B08111254D09A89F826EEFCCE"}} +2s
pw:protocol ◀ RECV {"method":"Inspector.detached","params":{"reason":"Render process gone."},"sessionId":"E9134B4B5CFD25CA8EBB016F9C97E3E7"} +3ms
The second pause event comes with a longer list of sec-ch-*
headers:
"sec-ch-ua":"\"(Not(A:Brand\";v=\"8\", \"Chromium\";v=\"98\"","sec-ch-ua-mobile":"?0","sec-ch-ua-platform":"\"macOS\""
"sec-ch-ua":"\"(Not(A:Brand\";v=\"8\", \"Chromium\";v=\"98\"","sec-ch-ua-mobile":"?0","sec-ch-ua-platform":"\"macOS\"", "sec-ch-ua-full-version":"\"98.0.4744.0\"","sec-ch-ua-arch":"\"x86\"","sec-ch-ua-platform-version":"\"10.15.7\"","sec-ch-ua-model":"\"\""
Filed upstream bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1279953
It looks like googe.com is only affected because of the brave experiments Chromium team is conducting. Let's see how real those scenarios will be in the real life.
The issue is not restricted to google.com
I have written a playwright test script that visits a website and uses page.route to intercept and inject a JS script. The request hangs only for chromium browser and works consistently for firefox.
This is still an issue that we have with python playwright. Any news on this?
I have same problem. any update?
do we have any update on this issue ?
Context:
System:
Binaries:
Languages:
npmPackages:
Code Snippet
Describe the bug
Any usage of page.route makes subsequest requests timeout. Even though no routes are matched and all requests are set to continue. If I remove the p.route part, it starts to work.