Skip to content

Commit 41d8fb2

Browse files
committed
Do some UC Mode refactoring
1 parent d23b375 commit 41d8fb2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

seleniumbase/undetected/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ def remove_cdc_props_as_needed(self):
367367
cdc_props = self._get_cdc_props()
368368
if len(cdc_props) > 0:
369369
self._hook_remove_cdc_props(cdc_props)
370+
time.sleep(0.05)
370371

371372
def get(self, url):
372373
self.remove_cdc_props_as_needed()
@@ -438,6 +439,10 @@ def quit(self):
438439
try:
439440
logger.debug("Terminating the UC browser")
440441
os.kill(self.browser_pid, 15)
442+
# Not sure if this is really needed:
443+
os.waitpid(self.browser_pid, 0)
444+
except (AttributeError, ChildProcessError, RuntimeError, OSError):
445+
pass
441446
except TimeoutError as e:
442447
logger.debug(e, exc_info=True)
443448
except Exception:

0 commit comments

Comments
 (0)