@@ -295,14 +295,14 @@ def extend_driver(
295295 driver .set_wire_proxy = DM .set_wire_proxy
296296 completed_loads = []
297297 for ext_dir in sb_config ._ext_dirs :
298- with suppress ( Exception ) :
299- if ext_dir not in completed_loads :
300- completed_loads . append ( ext_dir )
301- if not use_uc and os . path . exists ( os . path . abspath ( ext_dir ) ):
302- driver .webextension .install (os .path .abspath (ext_dir ))
298+ if ext_dir not in completed_loads :
299+ completed_loads . append ( ext_dir )
300+ if not use_uc and os . path . exists ( os . path . realpath ( ext_dir )):
301+ with suppress ( Exception ):
302+ driver .webextension .install (os .path .realpath (ext_dir ))
303303 if proxy_auth :
304- with suppress ( Exception ):
305- if not use_uc and os . path . exists ( proxy_helper . PROXY_DIR_PATH ):
304+ if not use_uc and os . path . exists ( proxy_helper . PROXY_DIR_PATH ):
305+ with suppress ( Exception ):
306306 driver .webextension .install (proxy_helper .PROXY_DIR_PATH )
307307 # Proxy needs a moment to load in Manifest V3
308308 if use_uc :
@@ -838,6 +838,7 @@ def uc_open_with_cdp_mode(driver, url=None, **kwargs):
838838 cdp .get_element_position = CDPM .get_element_position
839839 cdp .get_gui_element_rect = CDPM .get_gui_element_rect
840840 cdp .get_gui_element_center = CDPM .get_gui_element_center
841+ cdp .get_html = CDPM .get_html
841842 cdp .get_page_source = CDPM .get_page_source
842843 cdp .get_user_agent = CDPM .get_user_agent
843844 cdp .get_cookie_string = CDPM .get_cookie_string
@@ -934,6 +935,7 @@ def uc_open_with_cdp_mode(driver, url=None, **kwargs):
934935 cdp .core = core_items
935936 cdp .loop = cdp .get_event_loop ()
936937 driver .cdp = cdp
938+ driver .solve_captcha = CDPM .solve_captcha
937939 driver ._is_using_cdp = True
938940
939941
@@ -2477,7 +2479,7 @@ def _set_chrome_options(
24772479 # Can be a comma-separated list of .ZIP or .CRX files
24782480 extension_zip_list = extension_zip .split ("," )
24792481 for extension_zip_item in extension_zip_list :
2480- abs_path = os .path .abspath (extension_zip_item )
2482+ abs_path = os .path .realpath (extension_zip_item )
24812483 if os .path .exists (abs_path ):
24822484 try :
24832485 abs_path_dir = os .path .join (
@@ -2494,11 +2496,11 @@ def _set_chrome_options(
24942496 if extension_dir :
24952497 # load-extension input can be a comma-separated list
24962498 abs_path = (
2497- "," .join (os .path .abspath (p ) for p in extension_dir .split ("," ))
2499+ "," .join (os .path .realpath (p ) for p in extension_dir .split ("," ))
24982500 )
24992501 chrome_options = add_chrome_ext_dir (chrome_options , abs_path )
25002502 for p in extension_dir .split ("," ):
2501- sb_config ._ext_dirs .append (os .path .abspath (p ))
2503+ sb_config ._ext_dirs .append (os .path .realpath (p ))
25022504 if (
25032505 page_load_strategy
25042506 and page_load_strategy .lower () in ["eager" , "none" ]
@@ -2742,10 +2744,12 @@ def _set_chrome_options(
27422744 included_disabled_features .append (item )
27432745 d_f_string = "," .join (included_disabled_features )
27442746 chrome_options .add_argument ("--disable-features=%s" % d_f_string )
2747+ chrome_options .add_argument ("--enable-unsafe-extension-debugging" )
27452748 if proxy_auth :
27462749 chrome_options .add_argument ("--test-type" )
27472750 if proxy_auth or sb_config ._ext_dirs :
27482751 if not is_using_uc (undetectable , browser_name ):
2752+ chrome_options .add_argument ("--remote-debugging-pipe" )
27492753 chrome_options .enable_webextensions = True
27502754 chrome_options .enable_bidi = True
27512755 if (
@@ -4577,12 +4581,12 @@ def get_local_driver(
45774581 # Can be a comma-separated list of .ZIP or .CRX files
45784582 extension_zip_list = extension_zip .split ("," )
45794583 for extension_zip_item in extension_zip_list :
4580- abs_path = os .path .abspath (extension_zip_item )
4584+ abs_path = os .path .realpath (extension_zip_item )
45814585 edge_options .add_extension (abs_path )
45824586 if extension_dir :
45834587 # load-extension input can be a comma-separated list
45844588 abs_path = (
4585- "," .join (os .path .abspath (p ) for p in extension_dir .split ("," ))
4589+ "," .join (os .path .realpath (p ) for p in extension_dir .split ("," ))
45864590 )
45874591 edge_options = add_chrome_ext_dir (edge_options , abs_path )
45884592 edge_options .add_argument ("--disable-infobars" )
0 commit comments