From 8c07b7e127dd01d8f2f9ad46e8e6b79deac51a9c Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Thu, 11 Jan 2024 19:51:27 -0800 Subject: [PATCH] disable automatic chrome selfupdating --- archivebox/util.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/archivebox/util.py b/archivebox/util.py index 1543d493..d7df7f3c 100644 --- a/archivebox/util.py +++ b/archivebox/util.py @@ -239,8 +239,6 @@ def chrome_args(**options) -> List[str]: else: cmd_args += ('--headless',) - WINDOW_SIZE_FLAG = '--window-size={}'.format(options['RESOLUTION']) - if not options['CHROME_SANDBOX']: # assume this means we are running inside a docker container # in docker, GPU support is limited, sandboxing is unecessary, @@ -258,9 +256,13 @@ def chrome_args(**options) -> List[str]: "--use-fake-device-for-media-stream", "--disable-sync", # "--password-store=basic", - WINDOW_SIZE_FLAG, ) + + # disable automatic updating when running headless, as there's no user to see the upgrade prompts + cmd_args += ("--simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'",) + # set window size for screenshot/pdf/etc. rendering + cmd_args += ('--window-size={}'.format(options['RESOLUTION']),) if not options['CHECK_SSL_VALIDITY']: cmd_args += ('--disable-web-security', '--ignore-certificate-errors') @@ -268,9 +270,6 @@ def chrome_args(**options) -> List[str]: if options['CHROME_USER_AGENT']: cmd_args += ('--user-agent={}'.format(options['CHROME_USER_AGENT']),) - if options['RESOLUTION'] and WINDOW_SIZE_FLAG not in cmd_args: - cmd_args += (WINDOW_SIZE_FLAG,) - if options['CHROME_TIMEOUT']: cmd_args += ('--timeout={}'.format(options['CHROME_TIMEOUT'] * 1000),)