You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected the CDP call to CSS.enable to complete when request blocking is enabled.
Bug behavior
Flaky
PDF
Minimal, reproducible example
importpuppeteerfrom'puppeteer'consturl='https://chromestatus.com/features'constURLS_TO_BLOCK=['https://www.google-analytics.com/analytics.js']// Use Puppeteer to launch headful Chrome and don't use its default 800x600 viewport.constbrowser=awaitpuppeteer.launch({headless: false,defaultViewport: null,ignoreDefaultArgs: ['--enable-automation']})constpage=awaitbrowser.newPage()// Intercept request and block.// See https://pptr.dev/guides/request-interception for referenceawaitpage.setRequestInterception(true)page.on('request',request=>{if(request.isInterceptResolutionHandled())returnconstrequestURL=request.url()constrequestShouldBeBlocked=URLS_TO_BLOCK.includes(requestURL)if(requestShouldBeBlocked){console.log(`Blocked request to ${requestURL}`)request.abort()}else{request.continue()}})constsession=awaitpage.target().createCDPSession();awaitpage.goto(url,{waitUntil: ['networkidle0']});awaitsession.send('DOM.enable');console.log('Attempting CSS.enable...');awaitsession.send('CSS.enable');console.log('######## END ########');awaitbrowser.close()
Error string
Script hangs
Puppeteer configuration
No response
Puppeteer version
19.9.1
Node version
16.17.0
Package manager
yarn
Package manager version
1.22.19
Operating system
macOS
The text was updated successfully, but these errors were encountered:
This issue was not reproducible. Please check that your example runs locally and the following:
Ensure the script does not rely on dependencies outside of puppeteer and puppeteer-core.
Ensure the error string is just the error message.
Bad:
Error: somethingwentwrongatObject.<anonymous>(/Users/username/repository/script.js:2:1)atModule._compile(node:internal/modules/cjs/loader:1159:14)atModule._extensions..js(node:internal/modules/cjs/loader:1213:10)atModule.load(node:internal/modules/cjs/loader:1037:32)atModule._load(node:internal/modules/cjs/loader:878:12)atFunction.executeUserEntryPoint[asrunMain](node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
Good: Error: something went wrong.
Ensure your configuration file (if applicable) is valid.
If the issue is flaky (does not reproduce all the time), make sure 'Flaky' is checked.
If the issue is not expected to error, make sure to write 'no error'.
Once the above checks are satisfied, please edit your issue with the changes and we will
try to reproduce the bug again.
Looks like CSS.enable causes some network requests which do not emit proper events so Puppeteer keeps waiting for those events and CSS agent in Chromium keeps waiting for the requests to finish.
Bug expectation
I expected the CDP call to
CSS.enable
to complete when request blocking is enabled.Bug behavior
Minimal, reproducible example
Error string
Script hangs
Puppeteer configuration
No response
Puppeteer version
19.9.1
Node version
16.17.0
Package manager
yarn
Package manager version
1.22.19
Operating system
macOS
The text was updated successfully, but these errors were encountered: