Skip to content

Commit 902929a

Browse files
committed
Fix UC Mode issue with chromedriver 133
1 parent 36b8f78 commit 902929a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

seleniumbase/core/browser_launcher.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5394,6 +5394,19 @@ def get_local_driver(
53945394
)
53955395
driver._is_hidden = (headless or headless2)
53965396
driver._is_using_uc = True
5397+
with suppress(Exception):
5398+
if int(uc_driver_version) >= 133:
5399+
for window_handle in driver.window_handles:
5400+
driver.switch_to.window(window_handle)
5401+
if driver.current_url.startswith(
5402+
"chrome-extension://"
5403+
):
5404+
driver.close()
5405+
time.sleep(0.003)
5406+
driver.switch_to.window(driver.window_handles[0])
5407+
time.sleep(0.003)
5408+
driver.connect()
5409+
time.sleep(0.003)
53975410
if mobile_emulator:
53985411
uc_metrics = {}
53995412
if (

0 commit comments

Comments
 (0)