@@ -463,11 +463,16 @@ def uc_click(
463463 except Exception :
464464 pass
465465 element = driver .wait_for_selector (selector , by = by , timeout = timeout )
466- if not element .tag_name == "span" : # Element must be "visible"
466+ tag_name = element .tag_name
467+ if not tag_name == "span" : # Element must be "visible"
467468 element = driver .wait_for_element (selector , by = by , timeout = timeout )
468469 try :
469470 element .uc_click (
470- driver , selector , by = by , reconnect_time = reconnect_time
471+ driver ,
472+ selector ,
473+ by = by ,
474+ reconnect_time = reconnect_time ,
475+ tag_name = tag_name ,
471476 )
472477 except ElementClickInterceptedException :
473478 time .sleep (0.16 )
@@ -812,11 +817,12 @@ def _set_chrome_options(
812817 chrome_options = webdriver .edge .options .Options ()
813818 prefs = {}
814819 prefs ["download.default_directory" ] = downloads_path
815- prefs ["local_discovery.notifications_enabled" ] = False
816- prefs ["credentials_enable_service" ] = False
817- prefs ["download.prompt_for_download" ] = False
818820 prefs ["download.directory_upgrade" ] = True
821+ prefs ["download.prompt_for_download" ] = False
822+ prefs ["credentials_enable_service" ] = False
823+ prefs ["local_discovery.notifications_enabled" ] = False
819824 prefs ["safebrowsing.enabled" ] = False
825+ prefs ["safebrowsing.disable_download_protection" ] = True
820826 prefs ["omnibox-max-zero-suggest-matches" ] = 0
821827 prefs ["omnibox-use-existing-autocomplete-client" ] = 0
822828 prefs ["omnibox-trending-zero-prefix-suggestions-on-ntp" ] = 0
@@ -827,9 +833,8 @@ def _set_chrome_options(
827833 prefs ["omnibox-zero-suggest-prefetching-on-srp" ] = 0
828834 prefs ["omnibox-zero-suggest-prefetching-on-web" ] = 0
829835 prefs ["omnibox-zero-suggest-in-memory-caching" ] = 0
830- prefs ["default_content_setting_values.notifications" ] = 0
831836 prefs ["content_settings.exceptions.automatic_downloads.*.setting" ] = 1
832- prefs ["safebrowsing.disable_download_protection " ] = True
837+ prefs ["default_content_setting_values.notifications " ] = 0
833838 prefs ["default_content_settings.popups" ] = 0
834839 prefs ["managed_default_content_settings.popups" ] = 0
835840 prefs ["profile.password_manager_enabled" ] = False
@@ -1142,6 +1147,7 @@ def _set_chrome_options(
11421147 included_disabled_features .append ("PrivacySandboxSettings4" )
11431148 included_disabled_features .append ("DownloadBubble" )
11441149 included_disabled_features .append ("DownloadBubbleV2" )
1150+ included_disabled_features .append ("InsecureDownloadWarnings" )
11451151 for item in extra_disabled_features :
11461152 if item not in included_disabled_features :
11471153 included_disabled_features .append (item )
@@ -1153,6 +1159,7 @@ def _set_chrome_options(
11531159 included_disabled_features .append ("OptimizationTargetPrediction" )
11541160 included_disabled_features .append ("DownloadBubble" )
11551161 included_disabled_features .append ("DownloadBubbleV2" )
1162+ included_disabled_features .append ("InsecureDownloadWarnings" )
11561163 for item in extra_disabled_features :
11571164 if item not in included_disabled_features :
11581165 included_disabled_features .append (item )
@@ -2367,10 +2374,11 @@ def get_local_driver(
23672374 elif browser_name == constants .Browser .EDGE :
23682375 prefs = {
23692376 "download.default_directory" : downloads_path ,
2370- "local_discovery.notifications_enabled" : False ,
2371- "credentials_enable_service" : False ,
2372- "download.prompt_for_download" : False ,
23732377 "download.directory_upgrade" : True ,
2378+ "download.prompt_for_download" : False ,
2379+ "credentials_enable_service" : False ,
2380+ "local_discovery.notifications_enabled" : False ,
2381+ "safebrowsing.disable_download_protection" : True ,
23742382 "safebrowsing.enabled" : False ,
23752383 "omnibox-max-zero-suggest-matches" : 0 ,
23762384 "omnibox-use-existing-autocomplete-client" : 0 ,
@@ -2382,11 +2390,10 @@ def get_local_driver(
23822390 "omnibox-zero-suggest-prefetching-on-srp" : 0 ,
23832391 "omnibox-zero-suggest-prefetching-on-web" : 0 ,
23842392 "omnibox-zero-suggest-in-memory-caching" : 0 ,
2385- "safebrowsing.disable_download_protection " : True ,
2393+ "content_settings.exceptions.automatic_downloads.*.setting " : 1 ,
23862394 "default_content_setting_values.notifications" : 0 ,
23872395 "default_content_settings.popups" : 0 ,
23882396 "managed_default_content_settings.popups" : 0 ,
2389- "content_settings.exceptions.automatic_downloads.*.setting" : 1 ,
23902397 "profile.password_manager_enabled" : False ,
23912398 "profile.default_content_setting_values.notifications" : 2 ,
23922399 "profile.default_content_settings.popups" : 0 ,
@@ -2772,6 +2779,7 @@ def get_local_driver(
27722779 included_disabled_features .append ("Translate" )
27732780 included_disabled_features .append ("OptimizationTargetPrediction" )
27742781 included_disabled_features .append ("PrivacySandboxSettings4" )
2782+ included_disabled_features .append ("InsecureDownloadWarnings" )
27752783 for item in extra_disabled_features :
27762784 if item not in included_disabled_features :
27772785 included_disabled_features .append (item )
@@ -2781,6 +2789,7 @@ def get_local_driver(
27812789 included_disabled_features .append ("OptimizationHintsFetching" )
27822790 included_disabled_features .append ("Translate" )
27832791 included_disabled_features .append ("OptimizationTargetPrediction" )
2792+ included_disabled_features .append ("InsecureDownloadWarnings" )
27842793 for item in extra_disabled_features :
27852794 if item not in included_disabled_features :
27862795 included_disabled_features .append (item )
0 commit comments