(driver, url)
| 1748 | # Support methods for direct use from driver |
| 1749 | |
| 1750 | def open_url(driver, url): |
| 1751 | if __is_cdp_swap_needed(driver): |
| 1752 | driver.cdp.open(url) |
| 1753 | return |
| 1754 | elif ( |
| 1755 | getattr(driver, "_is_using_uc", None) |
| 1756 | # and getattr(driver, "_is_using_auth", None) |
| 1757 | and not getattr(driver, "_is_using_cdp", None) |
| 1758 | ): |
| 1759 | # Auth in UC Mode requires CDP Mode |
| 1760 | # (and now we're always forcing it) |
| 1761 | driver.uc_activate_cdp_mode(url) |
| 1762 | return |
| 1763 | elif ( |
| 1764 | getattr(driver, "_is_using_uc", None) |
| 1765 | and getattr(driver, "_is_using_cdp", None) |
| 1766 | ): |
| 1767 | driver.disconnect() |
| 1768 | driver.cdp.open(url) |
| 1769 | return |
| 1770 | url = str(url).strip() # Remove leading and trailing whitespace |
| 1771 | if not page_utils.looks_like_a_page_url(url): |
| 1772 | if page_utils.is_valid_url("https://" + url): |
| 1773 | url = "https://" + url |
| 1774 | driver.get(url) |
| 1775 | |
| 1776 | |
| 1777 | def click(driver, selector, by="css selector", timeout=settings.SMALL_TIMEOUT): |
nothing calls this directly
no test coverage detected
searching dependent graphs…