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

Method is_connected

seleniumbase/core/sb_driver.py:261–277  ·  view source on GitHub ↗

Return True if WebDriver is connected to the browser. Note that the stealthy CDP-Driver isn't a WebDriver. In CDP Mode, the CDP-Driver controls the web browser. The CDP-Driver can be connected while WebDriver isn't.

(self)

Source from the content-addressed store, hash-verified

259 return self.driver.execute_script("return navigator.onLine;")
260
261 def is_connected(self):
262 """
263 Return True if WebDriver is connected to the browser.
264 Note that the stealthy CDP-Driver isn't a WebDriver.
265 In CDP Mode, the CDP-Driver controls the web browser.
266 The CDP-Driver can be connected while WebDriver isn't.
267 """
268 if shared_utils.is_windows():
269 return (
270 not hasattr(self.driver, "_is_connected")
271 or self.driver._is_connected
272 )
273 try:
274 self.driver.window_handles
275 return True
276 except Exception:
277 return False
278
279 def is_uc_mode_active(self):
280 """Return True if the driver is using UC Mode. False otherwise."""

Callers 6

open_new_tabMethod · 0.45
uc_execute_cdp_cmdFunction · 0.45
uc_open_with_disconnectFunction · 0.45
uc_gui_click_x_yFunction · 0.45
_uc_gui_click_captchaFunction · 0.45
_uc_gui_handle_captcha_Function · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected