|
@@ -239,8 +239,6 @@ def chrome_args(**options) -> List[str]:
|
|
|
else:
|
|
else:
|
|
|
cmd_args += ('--headless',)
|
|
cmd_args += ('--headless',)
|
|
|
|
|
|
|
|
- WINDOW_SIZE_FLAG = '--window-size={}'.format(options['RESOLUTION'])
|
|
|
|
|
-
|
|
|
|
|
if not options['CHROME_SANDBOX']:
|
|
if not options['CHROME_SANDBOX']:
|
|
|
# assume this means we are running inside a docker container
|
|
# assume this means we are running inside a docker container
|
|
|
# in docker, GPU support is limited, sandboxing is unecessary,
|
|
# 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",
|
|
"--use-fake-device-for-media-stream",
|
|
|
"--disable-sync",
|
|
"--disable-sync",
|
|
|
# "--password-store=basic",
|
|
# "--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']:
|
|
if not options['CHECK_SSL_VALIDITY']:
|
|
|
cmd_args += ('--disable-web-security', '--ignore-certificate-errors')
|
|
cmd_args += ('--disable-web-security', '--ignore-certificate-errors')
|
|
@@ -268,9 +270,6 @@ def chrome_args(**options) -> List[str]:
|
|
|
if options['CHROME_USER_AGENT']:
|
|
if options['CHROME_USER_AGENT']:
|
|
|
cmd_args += ('--user-agent={}'.format(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']:
|
|
if options['CHROME_TIMEOUT']:
|
|
|
cmd_args += ('--timeout={}'.format(options['CHROME_TIMEOUT'] * 1000),)
|
|
cmd_args += ('--timeout={}'.format(options['CHROME_TIMEOUT'] * 1000),)
|
|
|
|
|
|