@@ -511,7 +511,7 @@ def _set_chrome_options(
511
511
chrome_options .add_argument ("--guest" )
512
512
else :
513
513
pass
514
- if user_data_dir and not undetectable :
514
+ if user_data_dir and not is_using_uc ( undetectable , browser_name ) :
515
515
abs_path = os .path .abspath (user_data_dir )
516
516
chrome_options .add_argument ("user-data-dir=%s" % abs_path )
517
517
if extension_zip :
@@ -597,10 +597,11 @@ def _set_chrome_options(
597
597
chrome_options .add_argument ("--proxy-pac-url=%s" % proxy_pac_url )
598
598
if browser_name != constants .Browser .OPERA :
599
599
# Opera Chromium doesn't support these switches
600
- chrome_options .add_argument ("--ignore-certificate-errors" )
600
+ if not is_using_uc (undetectable , browser_name ) or not enable_ws :
601
+ chrome_options .add_argument ("--ignore-certificate-errors" )
601
602
if not enable_ws :
602
603
chrome_options .add_argument ("--disable-web-security" )
603
- if "linux" in PLATFORM or not undetectable :
604
+ if "linux" in PLATFORM or not is_using_uc ( undetectable , browser_name ) :
604
605
chrome_options .add_argument ("--no-sandbox" )
605
606
else :
606
607
# Opera Chromium only!
@@ -946,7 +947,7 @@ def get_driver(
946
947
headless = True
947
948
if uc_subprocess and not undetectable :
948
949
undetectable = True
949
- if undetectable and mobile_emulator :
950
+ if is_using_uc ( undetectable , browser_name ) and mobile_emulator :
950
951
mobile_emulator = False
951
952
user_agent = None
952
953
proxy_auth = False
@@ -2164,7 +2165,7 @@ def get_local_driver(
2164
2165
edge_options .add_argument ("--allow-running-insecure-content" )
2165
2166
if user_agent :
2166
2167
edge_options .add_argument ("--user-agent=%s" % user_agent )
2167
- if "linux" in PLATFORM or not undetectable :
2168
+ if "linux" in PLATFORM or not is_using_uc ( undetectable , browser_name ) :
2168
2169
edge_options .add_argument ("--no-sandbox" )
2169
2170
if remote_debug :
2170
2171
# To access the Remote Debugger, go to: http://localhost:9222
@@ -2656,7 +2657,7 @@ def get_local_driver(
2656
2657
if selenium4_or_newer :
2657
2658
if headless and "linux" not in PLATFORM :
2658
2659
undetectable = False # No support for headless
2659
- if undetectable :
2660
+ if is_using_uc ( undetectable , browser_name ) :
2660
2661
from seleniumbase import undetected
2661
2662
from urllib .error import URLError
2662
2663
0 commit comments