Do some UC Mode refactoring

This commit is contained in:
Michael Mintz 2023-11-14 20:53:05 -05:00
parent d23b375a43
commit 41d8fb21ac
1 changed files with 5 additions and 0 deletions

View File

@ -367,6 +367,7 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
cdc_props = self._get_cdc_props()
if len(cdc_props) > 0:
self._hook_remove_cdc_props(cdc_props)
time.sleep(0.05)
def get(self, url):
self.remove_cdc_props_as_needed()
@ -438,6 +439,10 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
try:
logger.debug("Terminating the UC browser")
os.kill(self.browser_pid, 15)
# Not sure if this is really needed:
os.waitpid(self.browser_pid, 0)
except (AttributeError, ChildProcessError, RuntimeError, OSError):
pass
except TimeoutError as e:
logger.debug(e, exc_info=True)
except Exception: