@@ -534,7 +534,6 @@ def _set_chrome_options(
534
534
chrome_options .add_argument (
535
535
"--disable-blink-features=AutomationControlled"
536
536
)
537
- chrome_options .add_experimental_option ("useAutomationExtension" , False )
538
537
if headless2 :
539
538
chrome_options .add_argument ("--headless=chrome" )
540
539
elif headless :
@@ -595,7 +594,8 @@ def _set_chrome_options(
595
594
chrome_options .add_argument ("--ignore-certificate-errors" )
596
595
if not enable_ws :
597
596
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" )
599
599
else :
600
600
# Opera Chromium only!
601
601
chrome_options .add_argument ("--allow-elevated-browser" )
@@ -2025,7 +2025,6 @@ def get_local_driver(
2025
2025
edge_options .add_argument (
2026
2026
"--disable-blink-features=AutomationControlled"
2027
2027
)
2028
- edge_options .add_experimental_option ("useAutomationExtension" , False )
2029
2028
edge_options .add_experimental_option (
2030
2029
"excludeSwitches" , ["enable-automation" , "enable-logging" ]
2031
2030
)
@@ -2142,7 +2141,8 @@ def get_local_driver(
2142
2141
edge_options .add_argument ("--allow-running-insecure-content" )
2143
2142
if user_agent :
2144
2143
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" )
2146
2146
if remote_debug :
2147
2147
# To access the Remote Debugger, go to: http://localhost:9222
2148
2148
# while a Chromium driver is running.
0 commit comments