Skip to content

Commit

Permalink
fix chrome not being forced to headless for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
flowni committed Jan 5, 2025
1 parent 44a8037 commit 22645bd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions flathunter/chrome_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 22645bd

Please sign in to comment.