Skip to content

Commit

Permalink
Merge pull request #677 from staudenmeir/chromedriver
Browse files Browse the repository at this point in the history
[5.5] Improve detection of latest stable ChromeDriver release
  • Loading branch information
taylorotwell authored Sep 16, 2019
2 parents 9d2a643 + 993f49e commit 7cc0e7f
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 7cc0e7f

Please sign in to comment.