Skip to content

Commit 1757ef2

Browse files
committed
Refine UC Mode
1 parent bd9967a commit 1757ef2

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2667,10 +2667,7 @@ def __element_click(self, element):
26672667
try:
26682668
href = element.get_attribute("href")
26692669
target = element.get_attribute("target")
2670-
if len(href) > 0 and target == "_blank":
2671-
self.driver.tab_new(href)
2672-
self.switch_to_window(-1)
2673-
elif len(href) > 0:
2670+
if len(href) > 0 and target != "_blank":
26742671
element.uc_click()
26752672
else:
26762673
element.click()
@@ -3407,12 +3404,6 @@ def set_content_to_parent_frame(self):
34073404
def open_new_window(self, switch_to=True):
34083405
"""Opens a new browser tab/window and switches to it by default."""
34093406
self.wait_for_ready_state_complete()
3410-
if hasattr(self.driver, "tab_new"):
3411-
self.driver.tab_new("about:blank")
3412-
if switch_to:
3413-
self.switch_to_window(-1)
3414-
time.sleep(0.01)
3415-
return
34163407
if selenium4_or_newer and switch_to:
34173408
self.driver.switch_to.new_window("tab")
34183409
else:

0 commit comments

Comments
 (0)