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)
| 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.""" |
no outgoing calls
no test coverage detected