Apply undetected-chromedriver patches

* Hide Chrome window in Windows/NT
* Not use subprocess by default (independent process)
* Kill Chromium processes properly to avoid defunct/zombie processes
This commit is contained in:
ngosang
2023-01-06 17:23:56 +01:00
parent e163019f28
commit 410ee7981f
2 changed files with 12 additions and 4 deletions

View File

@@ -27,12 +27,14 @@ def start_detached(executable, *args):
reader, writer = multiprocessing.Pipe(False)
# do not keep reference
multiprocessing.Process(
process = multiprocessing.Process(
target=_start_detached,
args=(executable, *args),
kwargs={"writer": writer},
daemon=True,
).start()
)
process.start()
process.join()
# receive pid from pipe
pid = reader.recv()
REGISTERED.append(pid)