1
0
Fork 0
mirror of synced 2024-06-10 14:34:32 +12:00

disable automatic chrome selfupdating

This commit is contained in:
Nick Sweeting 2024-01-11 19:51:27 -08:00
parent 9766de1b70
commit 8c07b7e127

View file

@ -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),)