Skip to content

Commit

Permalink
Improve detection of latest stable ChromeDriver release
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed Sep 16, 2019
1 parent 9d2a643 commit 993f49e
Showing 1 changed file with 4 additions and 8 deletions.
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

0 comments on commit 993f49e

Please sign in to comment.