Skip to content

Fixes/new headless mode in chrome #3581

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

Merged

Conversation

gravityvi
Copy link
Member

Changes

  • changed headless argument for chrome to --headless=new from --headless=chrome according to the recent change in chrome. For more details refer this issue

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.
@@ -328,7 +328,7 @@ module.exports = class SeleniumCapabilities {

addHeadlessOption({options}) {
if (this.argv.headless && (options instanceof Capabilities) && (this.isChrome || options.headless)) {
this.isChrome ? options.addArguments('headless=chrome') : options.headless();
this.isChrome ? options.addArguments('headless=new') : options.headless();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the older versions of Chrome browser? Would --headless=new work with them as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no way to detect the version of the chrome browser before the driver creation. And people using older version of chrome will likely be using older version of nightwatch

Copy link
Member

@vaibhavsingh97 vaibhavsingh97 Jan 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should tag this as a breaking change

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we can also detect the version of chromedriver, right? Since chromedriver version == chrome version.
(Of course, only if it is worth doing. But I guess we can also pass the --headless=chrome argument directly in desired capabilities and it will work for older chrome versions?)

@beatfactor beatfactor merged commit 91e113f into nightwatchjs:main Jan 30, 2023
harshit-bs pushed a commit to harshit-bs/nightwatch that referenced this pull request Mar 16, 2023

Verified

This commit was signed with the committer’s verified signature.
harshit-bs Harshit Agrawal
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

Successfully merging this pull request may close these issues.

None yet

4 participants