When someone is using CDP Mode with a disconnected webdriver, but they forget to reconnect before calling a webdriver method, this method is used to substitute the webdriver method for a CDP Mode method instead, which keeps CDP Stealth Mode enabled. For other webdriver methods,
(driver)
| 156 | |
| 157 | |
| 158 | def is_cdp_swap_needed(driver): |
| 159 | """ |
| 160 | When someone is using CDP Mode with a disconnected webdriver, |
| 161 | but they forget to reconnect before calling a webdriver method, |
| 162 | this method is used to substitute the webdriver method for a |
| 163 | CDP Mode method instead, which keeps CDP Stealth Mode enabled. |
| 164 | For other webdriver methods, SeleniumBase will reconnect first. |
| 165 | """ |
| 166 | return ( |
| 167 | hasattr(driver, "is_cdp_mode_active") |
| 168 | and driver.is_cdp_mode_active() |
| 169 | and hasattr(driver, "is_connected") |
| 170 | and not driver.is_connected() |
| 171 | ) |
| 172 | |
| 173 | |
| 174 | def is_chrome_130_or_newer(self, binary_location=None): |
nothing calls this directly
no test coverage detected
searching dependent graphs…