Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dc6d5ab

Browse files
Hakadeldunglas
authored andcommitted
Ability to set a custom "google-chrome" binary (symfony#96)
* Add custom google-chrome binary support
1 parent 4694b91 commit dc6d5ab

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ The following environment variables can be set to change some Panther behaviors:
194194
* `PANTHER_CHROME_ARGUMENTS`: to customize `chromedriver` arguments. You need to set `PANTHER_NO_HEADLESS` to fully customize.
195195
* `PANTHER_WEB_SERVER_PORT`: to change the web server's port (default to `9080`)
196196
* `PANTHER_WEB_SERVER_ROUTER`: to use a web server router script which is run at the start of each HTTP request
197+
* `PANTHER_CHROME_BINARY`: to use another `google-chrome` binary
197198

198199
### Accepting Self-signed SSL Certificates
199200

src/ProcessManager/ChromeManager.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public function start(): WebDriver
5454
$chromeOptions = new ChromeOptions();
5555
$chromeOptions->addArguments($this->arguments);
5656
$capabilities->setCapability(ChromeOptions::CAPABILITY, $chromeOptions);
57+
if (isset($_SERVER['PANTHER_CHROME_BINARY'])) {
58+
$chromeOptions->setBinary($_SERVER['PANTHER_CHROME_BINARY']);
59+
}
5760
}
5861

5962
return RemoteWebDriver::create($url, $capabilities);

0 commit comments

Comments
 (0)