From 22645bd906363f0a5aeb1c80e7bcfa0cecd30e90 Mon Sep 17 00:00:00 2001 From: Nic Date: Sun, 5 Jan 2025 14:10:53 +0100 Subject: [PATCH] fix chrome not being forced to headless for macOS --- flathunter/chrome_wrapper.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flathunter/chrome_wrapper.py b/flathunter/chrome_wrapper.py index a62e8a71..661faa09 100644 --- a/flathunter/chrome_wrapper.py +++ b/flathunter/chrome_wrapper.py @@ -59,13 +59,12 @@ def get_chrome_driver(driver_arguments): """Configure Chrome WebDriver""" logger.info('Initializing Chrome WebDriver for crawler...') chrome_options = uc.ChromeOptions() # pylint: disable=no-member - if platform == "darwin": - chrome_options.add_argument("--headless") if driver_arguments is not None: for driver_argument in driver_arguments: chrome_options.add_argument(driver_argument) chrome_version = get_chrome_version() - chrome_options.add_argument("--headless=new") + if(platform != "darwin"): + chrome_options.add_argument("--headless=new") chrome_options.set_capability('goog:loggingPrefs', {'performance': 'ALL'}) driver = uc.Chrome(version_main=chrome_version, options=chrome_options) # pylint: disable=no-member