Skip to content

Commit 7cc0e7f

Browse files
authored
Merge pull request #677 from staudenmeir/chromedriver
[5.5] Improve detection of latest stable ChromeDriver release
2 parents 9d2a643 + 993f49e commit 7cc0e7f

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/Console/ChromeDriverCommand.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class ChromeDriverCommand extends Command
2929
protected $description = 'Install the ChromeDriver binary';
3030

3131
/**
32-
* URL to the home page.
32+
* URL to the latest stable release version.
3333
*
3434
* @var string
3535
*/
36-
protected $homeUrl = 'http://chromedriver.chromium.org/home';
36+
protected $latestVersionUrl = 'https://chromedriver.storage.googleapis.com/LATEST_RELEASE';
3737

3838
/**
39-
* URL to the latest release version.
39+
* URL to the latest release version for a major Chrome version.
4040
*
4141
* @var string
4242
*/
@@ -165,11 +165,7 @@ protected function version()
165165
*/
166166
protected function latestVersion()
167167
{
168-
$home = $this->getUrl($this->homeUrl);
169-
170-
preg_match('/release:.*?\?path=([\d.]+)/', $home, $matches);
171-
172-
return $matches[1];
168+
return trim(file_get_contents($this->latestVersionUrl));
173169
}
174170

175171
/**

0 commit comments

Comments
 (0)