Incompatible with Chrome v111 in headed mode: Using unsafe HTTP verb GET to invoke /json/new.
When used with Chrome and Chromium v111 in headed mode, the following error is encountered:
Warning: Trying to access array offset on value of type null in vendor/dmore/chrome-mink-driver/src/ChromeBrowser.php line 119
Then Chrome-Driver crashes into an exception.
The Problem:
In src/ChromeBrowser.php, lines 117-119:
$json = $this->http_client->get($this->http_uri . '/json/new');
$response = json_decode($json, true);
return $response['id'];
Chrome v111 returns the following:
Using unsafe HTTP verb GET to invoke /json/new. This action supports only PUT verb.
Then json_decode() decodes this string into null, which then blows up with the return.
Suggestion
It’d better to add the following under the json_decode():
if (!$response) {
throw new \RuntimeException(‘This version of Chrome is not compatible with dmore/chrome-php-driver.’);
}
Edited by Chris Burgess