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

[5.5] Improve detection of latest stable ChromeDriver release #677

Merged
merged 1 commit into from
Sep 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/Console/ChromeDriverCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class ChromeDriverCommand extends Command
protected $description = 'Install the ChromeDriver binary';

/**
* URL to the home page.
* URL to the latest stable release version.
*
* @var string
*/
protected $homeUrl = 'http://chromedriver.chromium.org/home';
protected $latestVersionUrl = 'https://chromedriver.storage.googleapis.com/LATEST_RELEASE';

/**
* URL to the latest release version.
* URL to the latest release version for a major Chrome version.
*
* @var string
*/
Expand Down Expand Up @@ -165,11 +165,7 @@ protected function version()
*/
protected function latestVersion()
{
$home = $this->getUrl($this->homeUrl);

preg_match('/release:.*?\?path=([\d.]+)/', $home, $matches);

return $matches[1];
return trim(file_get_contents($this->latestVersionUrl));
}

/**
Expand Down