add parameter: extra_chrome_arguments

This commit is contained in:
Milan Hauth 2023-12-08 18:10:38 +01:00
parent 783b839315
commit dd71a48e28
1 changed files with 5 additions and 0 deletions

View File

@ -124,6 +124,7 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
use_subprocess=True,
debug=False,
no_sandbox=True,
extra_chrome_arguments=[],
user_multi_procs: bool = False,
**kw,
):
@ -421,6 +422,10 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
if hasattr(options, "handle_prefs"):
options.handle_prefs(user_data_dir)
if extra_chrome_arguments:
for arg in extra_chrome_arguments:
options.add_argument(arg)
# fix exit_type flag to prevent tab-restore nag
try:
with open(