@@ -463,11 +463,16 @@ def uc_click(
463
463
except Exception :
464
464
pass
465
465
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"
467
468
element = driver .wait_for_element (selector , by = by , timeout = timeout )
468
469
try :
469
470
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 ,
471
476
)
472
477
except ElementClickInterceptedException :
473
478
time .sleep (0.16 )
@@ -812,11 +817,12 @@ def _set_chrome_options(
812
817
chrome_options = webdriver .edge .options .Options ()
813
818
prefs = {}
814
819
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
818
820
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
819
824
prefs ["safebrowsing.enabled" ] = False
825
+ prefs ["safebrowsing.disable_download_protection" ] = True
820
826
prefs ["omnibox-max-zero-suggest-matches" ] = 0
821
827
prefs ["omnibox-use-existing-autocomplete-client" ] = 0
822
828
prefs ["omnibox-trending-zero-prefix-suggestions-on-ntp" ] = 0
@@ -827,9 +833,8 @@ def _set_chrome_options(
827
833
prefs ["omnibox-zero-suggest-prefetching-on-srp" ] = 0
828
834
prefs ["omnibox-zero-suggest-prefetching-on-web" ] = 0
829
835
prefs ["omnibox-zero-suggest-in-memory-caching" ] = 0
830
- prefs ["default_content_setting_values.notifications" ] = 0
831
836
prefs ["content_settings.exceptions.automatic_downloads.*.setting" ] = 1
832
- prefs ["safebrowsing.disable_download_protection " ] = True
837
+ prefs ["default_content_setting_values.notifications " ] = 0
833
838
prefs ["default_content_settings.popups" ] = 0
834
839
prefs ["managed_default_content_settings.popups" ] = 0
835
840
prefs ["profile.password_manager_enabled" ] = False
@@ -1142,6 +1147,7 @@ def _set_chrome_options(
1142
1147
included_disabled_features .append ("PrivacySandboxSettings4" )
1143
1148
included_disabled_features .append ("DownloadBubble" )
1144
1149
included_disabled_features .append ("DownloadBubbleV2" )
1150
+ included_disabled_features .append ("InsecureDownloadWarnings" )
1145
1151
for item in extra_disabled_features :
1146
1152
if item not in included_disabled_features :
1147
1153
included_disabled_features .append (item )
@@ -1153,6 +1159,7 @@ def _set_chrome_options(
1153
1159
included_disabled_features .append ("OptimizationTargetPrediction" )
1154
1160
included_disabled_features .append ("DownloadBubble" )
1155
1161
included_disabled_features .append ("DownloadBubbleV2" )
1162
+ included_disabled_features .append ("InsecureDownloadWarnings" )
1156
1163
for item in extra_disabled_features :
1157
1164
if item not in included_disabled_features :
1158
1165
included_disabled_features .append (item )
@@ -2367,10 +2374,11 @@ def get_local_driver(
2367
2374
elif browser_name == constants .Browser .EDGE :
2368
2375
prefs = {
2369
2376
"download.default_directory" : downloads_path ,
2370
- "local_discovery.notifications_enabled" : False ,
2371
- "credentials_enable_service" : False ,
2372
- "download.prompt_for_download" : False ,
2373
2377
"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 ,
2374
2382
"safebrowsing.enabled" : False ,
2375
2383
"omnibox-max-zero-suggest-matches" : 0 ,
2376
2384
"omnibox-use-existing-autocomplete-client" : 0 ,
@@ -2382,11 +2390,10 @@ def get_local_driver(
2382
2390
"omnibox-zero-suggest-prefetching-on-srp" : 0 ,
2383
2391
"omnibox-zero-suggest-prefetching-on-web" : 0 ,
2384
2392
"omnibox-zero-suggest-in-memory-caching" : 0 ,
2385
- "safebrowsing.disable_download_protection " : True ,
2393
+ "content_settings.exceptions.automatic_downloads.*.setting " : 1 ,
2386
2394
"default_content_setting_values.notifications" : 0 ,
2387
2395
"default_content_settings.popups" : 0 ,
2388
2396
"managed_default_content_settings.popups" : 0 ,
2389
- "content_settings.exceptions.automatic_downloads.*.setting" : 1 ,
2390
2397
"profile.password_manager_enabled" : False ,
2391
2398
"profile.default_content_setting_values.notifications" : 2 ,
2392
2399
"profile.default_content_settings.popups" : 0 ,
@@ -2772,6 +2779,7 @@ def get_local_driver(
2772
2779
included_disabled_features .append ("Translate" )
2773
2780
included_disabled_features .append ("OptimizationTargetPrediction" )
2774
2781
included_disabled_features .append ("PrivacySandboxSettings4" )
2782
+ included_disabled_features .append ("InsecureDownloadWarnings" )
2775
2783
for item in extra_disabled_features :
2776
2784
if item not in included_disabled_features :
2777
2785
included_disabled_features .append (item )
@@ -2781,6 +2789,7 @@ def get_local_driver(
2781
2789
included_disabled_features .append ("OptimizationHintsFetching" )
2782
2790
included_disabled_features .append ("Translate" )
2783
2791
included_disabled_features .append ("OptimizationTargetPrediction" )
2792
+ included_disabled_features .append ("InsecureDownloadWarnings" )
2784
2793
for item in extra_disabled_features :
2785
2794
if item not in included_disabled_features :
2786
2795
included_disabled_features .append (item )
0 commit comments