HyJavaImages Library
By upgrading to HyJavaImages library v1.6.0 or newer these Chrome headless changes are handled. Users do not need to do anything else.
If you remain on HyJavaImages library v1.5.6 or older, you should understand the issue and choose one of the options below.
Chrome Versions 111 and Older
For Chrome versions 111 and older, there is only one version of Chrome headless available.
The Chrome argument “–headless” will start Chrome in headless mode.
For HyJavaImages library v1.5.6 and older, the library automatically adds the argument “–headless”.
Chrome Versions 112 and Newer
For Chrome versions 112 and newer, there are now “old” and “new” Chrome headless versions available.
The Chrome argument “–headless” will start Chrome in the “old” headless mode. (See the Issue below)
The Chrome argument “–headless=old” will start Chrome in the “old” headless mode.
The Chrome argument “–headless=new” will start Chrome in the “new” headless mode.
For HyJavaImages library v1.6.0 or newer the default is to use the “old” Chrome headless.
The library automatically adds the argument “–headless=old”.
Issue
Currently (as of April 2023) “–headless” will default to use the “old” Chrome headless.
However at some unspecified time later this year (2023) Chrome developers will swap this over, so that “–headless” will start using the “new” Chrome headless.
This will mean users on HyJavaImages library v1.5.6 and older, will go from “old” to “new” Chrome headless without warning. This is clearly not ideal.
NOTE: The “new headless” has a number of issues as of Chrome version 112 and we do not recommend using it.
Your Options
1. Upgrade to HyJavaImages library v1.6.0 or newer. The library default is to use the “old” Chrome headless.
2. Remain on HyJavaImages library v1.5.6 or older, with the following Chrome arguments.
Chrome chrome = Chrome.getInstance();
chrome.setChromeArguments(new ChromeArguments().removeArgument("--headless").addArgument("--headless=old"));
chrome.start();
3. Remain on a version of Chrome that by default uses the “old” Chrome headless.
New Chrome Headless
Users that wish to test the “new” Chrome headless can do so with HyJavaImages library v1.6.0 or newer and the following Chrome arguments.
Chrome chrome = Chrome.getInstance();
chrome.setChromeArguments(new ChromeArguments().setChromeHeadlessType(ChromeHeadlessType.HEADLESS_NEW));
chrome.start();