From dffdc88fd5baf3288748c43af1ab1f5cfb458eba Mon Sep 17 00:00:00 2001 From: Taka Date: Wed, 28 Nov 2018 14:05:43 +0000 Subject: [PATCH] Made the location of Chrome/Chromium configurable. --- vasl_templates/webapp/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vasl_templates/webapp/utils.py b/vasl_templates/webapp/utils.py index a665ab2..a6d736f 100644 --- a/vasl_templates/webapp/utils.py +++ b/vasl_templates/webapp/utils.py @@ -62,6 +62,11 @@ class HtmlScreenshots: if "chromedriver" in webdriver_path: options = webdriver.ChromeOptions() options.set_headless( headless=True ) + # OMG! The chromedriver looks for Chrome/Chromium in a hard-coded, fixed location (the default + # installation directory). We offer a way here to override this. + chrome_path = app.config.get( "CHROME_PATH" ) + if chrome_path: + options.binary_location = chrome_path kwargs["chrome_options"] = options self.webdriver = webdriver.Chrome( **kwargs ) elif "geckodriver" in webdriver_path: