Skip to content
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

[Feature] New headless chrome #21194

Closed
Smrtnyk opened this issue Feb 24, 2023 · 4 comments
Closed

[Feature] New headless chrome #21194

Smrtnyk opened this issue Feb 24, 2023 · 4 comments

Comments

@Smrtnyk
Copy link

Smrtnyk commented Feb 24, 2023

Is it already possible to use new headless chrome with playwright?
https://developer.chrome.com/articles/new-headless/

@yury-s
Copy link
Member

yury-s commented Feb 24, 2023

You can give it a try today, most of the stuff will work but we don't run our tests with it yet and some tests are know to fail, so be prepared for some functionality working in the current headless mode but failing in the new one:

  projects: [
    {
      name: 'chromium',
      use: {
        launchOptions: {
          ignoreDefaultArgs: ['--headless'],
          args: ['--headless=new']
        }
      },
    },

We'll announce separately when the new mode is fully supported.

@yury-s yury-s closed this as completed Feb 24, 2023
@Smrtnyk
Copy link
Author

Smrtnyk commented Feb 24, 2023

tnx, I gave it a try, but it is spamming the playwright inspector windows being open, while browser was still in headless mode, and I had to press play all the time in order for tests to actually continue.
I guess I will wait for an official support.

@mirao
Copy link

mirao commented Oct 1, 2024

@yury-s I think the correct option is ignoreDefaultArgs: ['--headless=old'] instead of ignoreDefaultArgs: ['--headless']

Just tested it in CodeceptJS + Playwright.

  • When I use ignoreDefaultArgs: ['--headless'], Chromium will start with both options --headless=old and --headless=new. The new headless mode works in such case, but passing of both parameters is ambiguous.
  • When I use ignoreDefaultArgs: ['--headless=old'], Chromium will start without the option --headless=old, but with --headless=new enabled which is what I expect

@mirao
Copy link

mirao commented Oct 1, 2024

@yury-s I think the correct option is ignoreDefaultArgs: ['--headless=old'] instead of ignoreDefaultArgs: ['--headless']

I guess it might change by time. Maybe the older Chromium versions used --headless.
I'm testing it with Playwright 1.46.1 with Chromium 128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants