MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / uc_open_with_tab

Function uc_open_with_tab

seleniumbase/core/browser_launcher.py:570–586  ·  view source on GitHub ↗
(driver, url)

Source from the content-addressed store, hash-verified

568
569
570def uc_open_with_tab(driver, url):
571 url = shared_utils.fix_url_as_needed(url)
572 if __is_cdp_swap_needed(driver):
573 driver.cdp.get(url)
574 time.sleep(0.3)
575 return
576 if (url.startswith("http:") or url.startswith("https:")):
577 if not hasattr(driver, "cdp_base"):
578 with driver:
579 driver.execute_script('window.open("%s","_blank");' % url)
580 driver.close()
581 else:
582 driver.cdp.open(url)
583 page_actions.switch_to_window(driver, driver.window_handles[-1], 2)
584 else:
585 driver.default_get(url) # The original one
586 return None
587
588
589def uc_open_with_reconnect(driver, url, reconnect_time=None):

Callers 1

get_local_driverFunction · 0.85

Calls 7

closeMethod · 0.80
__is_cdp_swap_neededFunction · 0.70
getMethod · 0.45
sleepMethod · 0.45
execute_scriptMethod · 0.45
openMethod · 0.45
switch_to_windowMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…