Skip to content

Commit 96e3bcd

Browse files
authored
Merge pull request #4097 from seleniumbase/cdp-mode-patch-74
CDP Mode: Patch 74
2 parents 40407cb + ec75437 commit 96e3bcd

File tree

5 files changed

+32
-3
lines changed

5 files changed

+32
-3
lines changed

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.44.9"
2+
__version__ = "4.44.10"

seleniumbase/core/browser_launcher.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,9 @@ def extend_driver(
300300
if not use_uc and os.path.exists(os.path.realpath(ext_dir)):
301301
with suppress(Exception):
302302
driver.webextension.install(os.path.realpath(ext_dir))
303+
driver._is_using_auth = False
303304
if proxy_auth:
305+
driver._is_using_auth = True
304306
if not use_uc and os.path.exists(proxy_helper.PROXY_DIR_PATH):
305307
with suppress(Exception):
306308
driver.webextension.install(proxy_helper.PROXY_DIR_PATH)
@@ -5786,6 +5788,7 @@ def get_local_driver(
57865788
)
57875789
driver.default_get = driver.get # Save copy of original
57885790
driver.cdp = None # Set a placeholder
5791+
driver._is_using_uc = False
57895792
driver._is_using_cdp = False
57905793
driver._is_connected = True
57915794
if uc_activated:

seleniumbase/fixtures/base_case.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ def open(self, url):
230230
elif (
231231
hasattr(self.driver, "_is_using_uc")
232232
and self.driver._is_using_uc
233-
and "@" in self.proxy_string
233+
and hasattr(self.driver, "_is_using_auth")
234+
and self.driver._is_using_auth
234235
and (
235236
not hasattr(self.driver, "_is_using_cdp")
236237
or not self.driver._is_using_cdp

seleniumbase/fixtures/page_actions.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,6 +1756,28 @@ def open_url(driver, url):
17561756
if __is_cdp_swap_needed(driver):
17571757
driver.cdp.open(url)
17581758
return
1759+
elif (
1760+
hasattr(driver, "_is_using_uc")
1761+
and driver._is_using_uc
1762+
and hasattr(driver, "_is_using_auth")
1763+
and driver._is_using_auth
1764+
and (
1765+
not hasattr(driver, "_is_using_cdp")
1766+
or not driver._is_using_cdp
1767+
)
1768+
):
1769+
# Auth in UC Mode requires CDP Mode
1770+
driver.uc_activate_cdp_mode(url)
1771+
return
1772+
elif (
1773+
hasattr(driver, "_is_using_uc")
1774+
and driver._is_using_uc
1775+
and hasattr(driver, "_is_using_cdp")
1776+
and driver._is_using_cdp
1777+
):
1778+
driver.disconnect()
1779+
driver.cdp.open(url)
1780+
return
17591781
url = str(url).strip() # Remove leading and trailing whitespace
17601782
if not page_utils.looks_like_a_page_url(url):
17611783
if page_utils.is_valid_url("https://" + url):

seleniumbase/plugins/driver_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,10 @@ def Driver(
742742
uc_cdp_events = True
743743
else:
744744
uc_cdp_events = False
745-
if undetectable and browser != "chrome":
745+
if (
746+
undetectable
747+
and browser not in ["chrome", "opera", "brave", "comet", "atlas"]
748+
):
746749
message = (
747750
'\n Undetected-Chromedriver Mode ONLY supports Chrome!'
748751
'\n ("uc=True" / "undetectable=True" / "--uc")'

0 commit comments

Comments
 (0)