Skip to content

Commit ac8d77e

Browse files
committed
Fix UC Mode headless issue on macOS for Chrome 120+
1 parent 570910c commit ac8d77e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

seleniumbase/undetected/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,13 @@ def quit(self):
446446
try:
447447
logger.debug("Terminating the UC browser")
448448
os.kill(self.browser_pid, 15)
449-
if IS_POSIX:
449+
if "linux" in sys.platform:
450450
os.waitpid(self.browser_pid, 0)
451+
time.sleep(0.02)
451452
else:
452-
time.sleep(0.05)
453+
time.sleep(0.04)
453454
except (AttributeError, ChildProcessError, RuntimeError, OSError):
454-
pass
455+
time.sleep(0.05)
455456
except TimeoutError as e:
456457
logger.debug(e, exc_info=True)
457458
except Exception:

0 commit comments

Comments
 (0)