@@ -445,11 +445,11 @@ def has_captcha(text):
445445 or 'action="/?__cf_chl_f_tk' in text
446446 or 'id="challenge-widget-' in text
447447 or 'src="chromedriver.js"' in text
448+ or "com/recaptcha/api.js" in text
448449 or 'class="g-recaptcha"' in text
449450 or 'content="Pixelscan"' in text
450451 or 'id="challenge-form"' in text
451452 or "window._cf_chl_opt" in text
452- or "/recaptcha/api.js" in text
453453 or "/turnstile/" in text
454454 ):
455455 return True
@@ -694,6 +694,7 @@ def uc_open_with_cdp_mode(driver, url=None, **kwargs):
694694 xvfb = xvfb ,
695695 xvfb_metrics = xvfb_metrics ,
696696 browser_executable_path = binary_location ,
697+ mobile = getattr (sb_config , "_cdp_mobile_mode" , None ),
697698 )
698699 )
699700 loop .run_until_complete (driver .cdp_base .wait (0 ))
@@ -2761,6 +2762,8 @@ def _set_chrome_options(
27612762 included_disabled_features .append ("SidePanelPinning" )
27622763 included_disabled_features .append ("UserAgentClientHint" )
27632764 included_disabled_features .append ("DisableLoadExtensionCommandLineSwitch" )
2765+ included_disabled_features .append ("WebAuthentication" )
2766+ included_disabled_features .append ("PasskeyAuth" )
27642767 for item in extra_disabled_features :
27652768 if item not in included_disabled_features :
27662769 included_disabled_features .append (item )
@@ -3056,11 +3059,6 @@ def get_driver(
30563059 if _special_binary_exists (binary_location , "atlas" ):
30573060 driver_dir = DRIVER_DIR_ATLAS
30583061 sb_config ._cdp_browser = "atlas"
3059- if undetectable and mobile_emulator :
3060- # For stealthy mobile mode, see the CDP Mode examples
3061- # to learn how to properly configure it.
3062- user_agent = None # Undo the override
3063- mobile_emulator = False # Instead, set from CDP Mode
30643062 if (
30653063 hasattr (sb_config , "settings" )
30663064 and getattr (sb_config .settings , "NEW_DRIVER_DIR" , None )
@@ -3075,6 +3073,23 @@ def get_driver(
30753073 if browser_name in constants .ChromiumSubs .chromium_subs :
30763074 browser_name = "chrome"
30773075 browser_name = browser_name .lower ()
3076+ if is_using_uc (undetectable , browser_name ):
3077+ if ad_block_on :
3078+ sb_config .ad_block_on = True
3079+ else :
3080+ sb_config .ad_block_on = False
3081+ if disable_csp :
3082+ sb_config .disable_csp = True
3083+ else :
3084+ sb_config .disable_csp = False
3085+ if mobile_emulator :
3086+ # For stealthy mobile mode, see the CDP Mode examples
3087+ # to learn how to properly configure it.
3088+ user_agent = None # Undo the override
3089+ mobile_emulator = False # Instead, set from CDP Mode
3090+ sb_config ._cdp_mobile_mode = True
3091+ else :
3092+ sb_config ._cdp_mobile_mode = False
30783093 if headless2 and browser_name == constants .Browser .FIREFOX :
30793094 headless2 = False # Only for Chromium
30803095 headless = True
0 commit comments