-
Notifications
You must be signed in to change notification settings - Fork 276
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
[1.11] Add support for the new Chrome headless mode #504
base: 1.11
Are you sure you want to change the base?
Conversation
Thanks for looking into this. This looks like a great solution. Are you able to add test coverage and update the documentation too, please? |
Sure. Having a hard time coming up with a test though. From what I can tell Chrome has no way of differentiating between the old and new headless mode. Do you know about some flag I could check? Or is there a way I could read the parsed options from a BrowserProcess and check the mode there? |
Fair enough. I'd merge with just the updated docs, then. ;) |
I just tested the new headless mode using the following code in a Docker container:
I received the following error using Google Chrome 112.0.5615.165:
Using the normal headless mode works fine without any issues. |
That's similar to #401. If you create that file manually, does the error change? |
When I manually create
|
Chrome is switching by default to the new headless version later this year, this is not working in Docker (yet). We could allow the following configuration values:
Reference: https://developer.chrome.com/articles/new-headless/ |
FYI, the new Headless mode seems to work in version 113 and 114 using Docker. |
I don't really see the need for the "old" option. Setting the flag to true already enables the old headless mode, and by the time the default switches to the new one, they'll likely remove the old mode altogether. Keeping true/false backwards compatible and adding the "new" option is the way to go IMOm (just like Puppeteer has it) |
This issue has been automatically marked as stale because there has been no recent activity. It will be closed after 30 days if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because there has been no recent activity. It will be closed after 30 days if no further activity occurs. Thank you for your contributions. |
Fixes #498
Reference: https://developer.chrome.com/articles/new-headless/
Imlemented just like Puppeteer:
Passing true or not setting the flag at all still enables the old mode. False still disables the headless mode. Passing "new" enables the new headless mode.
From the blog post:
This code will work during the transition period and allow users to test their applications against the new set-up
When the old headless mode is removed, the default in this library might have to be switched to "new" (or Chrome will simply map --headless to --headless=new internally, we don't know yet)