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
puppeteer.launch() never returns when using --no-startup-window #3630
Comments
Been trying a few things to get to try to get to the bottom of what is going, so I downgraded to puppeteer 1.3.0 (the version I was originally successfully using) and that works. 1.3.0 ok |
It's blocking on:- After calling Browser.create, before waiting for the initialPagePromise puppeteer:protocol SEND ► {"id":1,"method":"Target.setDiscoverTargets","params":{"discover":true}} +0ms After calling await initialPagePromise:- puppeteer:protocol ◀ RECV {"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"9606E8989A3213A624AB71E9AD5CD75A","type":"background_page","title":"CryptoTokenExtension","url":"chrome-extension://kmendfapggjehodndflmmgagdbamhnfd/_generated_background_page.html","attached":false,"browserContextId":"2D5F7FD876DC28A3F99652FB095AA448"}}} +123ms Then after a short delay puppeteer:protocol ◀ RECV {"method":"Target.targetDestroyed","params":{"targetId":"9606E8989A3213A624AB71E9AD5CD75A"}} +15s |
Puppeteer expects and waits for a page on startup. Passing |
The way my code works is (in 1.3.0 and 1.4.0) It calls
All perfectly reasonable, I thought. But that code does not work since 1.6.2 because The error I am seeing if I don't add
The issue is that the order of the two pages (targets) that is returned by I can ofc fix my code to remove that assumption, but the real question is, is the first example considered code that should work? Because it certainly used to. |
@Mehuge so what is the motivation to pass const browser = await pptr.launch();
const [page] = await browser.pages(); |
That is essentially what my code is now doing. https://github.com/redskyit/dalang/blob/master/dalang.js#L127 The motivation was indeed to avoid the second tab (in headless: false mode). |
Looks like this is solved then :-) |
The existing behavior is expected to be unchanged as the value defaults to true. Adding such option would allow user to skip the initial wait. Issue: #3630
Steps to reproduce
Tell us about your environment:
What steps will reproduce the problem?
await puppeteer.launch({ headless: false, sloMo: 0, args: [
'--window-size=400,714',
'--unlimited-storage',
'--no-startup-window',
'--disable-dev-shm-usage',
'--disable-crash-reporter',
'--disable-breakpad'
]});
What is the expected result?
Chromium to launch, and puppeteer.launch() return.
What happens instead?
The dock icon for puppeteer appears, but puppeteer.launch() never returns.
I added a console.log to puppeteer/lib/Launcher.js to output the full command line being run, in case that helps.
/Users/adf/Projects/dalang/node_modules/puppeteer/.local-chromium/mac-609904/chrome-mac/Chromium.app/Contents/MacOS/Chromium --disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=site-per-process --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --disable-translate --metrics-recording-only --no-first-run --safebrowsing-disable-auto-update --enable-automation --password-store=basic --use-mock-keychain about:blank --window-size=400,714 --unlimited-storage --no-startup-window --disable-dev-shm-usage --disable-crash-reporter --disable-breakpad --remote-debugging-port=0 --user-data-dir=/var/folders/7r/_3bt2vjs2lb7ql4tg98983x00000gn/T/puppeteer_dev_profile-l9JwIX
If I click on the dock icon that appeared for chromium, puppeteer.launch() then returns.
If I set executablePath to point at my normal Chrome executable (
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome
), puppeteer.launch() works as expected.The text was updated successfully, but these errors were encountered: