Skip to content

Commit 4a14bb3

Browse files
committed
Optimize Chromium options
1 parent 3e651f1 commit 4a14bb3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

seleniumbase/core/browser_launcher.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,6 @@ def _set_chrome_options(
534534
chrome_options.add_argument(
535535
"--disable-blink-features=AutomationControlled"
536536
)
537-
chrome_options.add_experimental_option("useAutomationExtension", False)
538537
if headless2:
539538
chrome_options.add_argument("--headless=chrome")
540539
elif headless:
@@ -595,7 +594,8 @@ def _set_chrome_options(
595594
chrome_options.add_argument("--ignore-certificate-errors")
596595
if not enable_ws:
597596
chrome_options.add_argument("--disable-web-security")
598-
chrome_options.add_argument("--no-sandbox")
597+
if "linux" in PLATFORM or not undetectable:
598+
chrome_options.add_argument("--no-sandbox")
599599
else:
600600
# Opera Chromium only!
601601
chrome_options.add_argument("--allow-elevated-browser")
@@ -2025,7 +2025,6 @@ def get_local_driver(
20252025
edge_options.add_argument(
20262026
"--disable-blink-features=AutomationControlled"
20272027
)
2028-
edge_options.add_experimental_option("useAutomationExtension", False)
20292028
edge_options.add_experimental_option(
20302029
"excludeSwitches", ["enable-automation", "enable-logging"]
20312030
)
@@ -2142,7 +2141,8 @@ def get_local_driver(
21422141
edge_options.add_argument("--allow-running-insecure-content")
21432142
if user_agent:
21442143
edge_options.add_argument("--user-agent=%s" % user_agent)
2145-
edge_options.add_argument("--no-sandbox")
2144+
if "linux" in PLATFORM or not undetectable:
2145+
edge_options.add_argument("--no-sandbox")
21462146
if remote_debug:
21472147
# To access the Remote Debugger, go to: http://localhost:9222
21482148
# while a Chromium driver is running.

0 commit comments

Comments
 (0)