Skip to content

Commit 23c2a75

Browse files
committed
Always subprocess undetectable-chromedriver when used
1 parent 2252cc3 commit 23c2a75

File tree

6 files changed

+18
-12
lines changed

6 files changed

+18
-12
lines changed

seleniumbase/core/browser_launcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,7 +2691,7 @@ def get_local_driver(
26912691
driver_executable_path=uc_path,
26922692
headless=False, # Xvfb needed!
26932693
version_main=uc_chrome_version,
2694-
use_subprocess=uc_subprocess,
2694+
use_subprocess=True, # Always!
26952695
)
26962696
except URLError as e:
26972697
if (
@@ -2709,7 +2709,7 @@ def get_local_driver(
27092709
driver_executable_path=uc_path,
27102710
headless=False, # Xvfb needed!
27112711
version_main=uc_chrome_version,
2712-
use_subprocess=uc_subprocess,
2712+
use_subprocess=True, # Always!
27132713
)
27142714
else:
27152715
raise

seleniumbase/plugins/driver_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ def Driver(
258258
undetectable = True
259259
if (
260260
(undetectable or undetected or uc)
261-
and uc_subprocess is None
262-
and uc_sub is None
261+
and (uc_subprocess is None)
262+
and (uc_sub is None)
263263
):
264264
uc_subprocess = True # Use UC as a subprocess by default.
265265
elif (
@@ -271,6 +271,8 @@ def Driver(
271271
or "--uc-sub" in sys_argv
272272
):
273273
undetectable = True
274+
if uc_subprocess is None and uc_sub is None:
275+
uc_subprocess = True # Use UC as a subprocess by default.
274276
else:
275277
undetectable = False
276278
if uc_subprocess or uc_sub:

seleniumbase/plugins/pytest_plugin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,8 +920,9 @@ def pytest_addoption(parser):
920920
"--uc-sub", # undetected-chromedriver subprocess mode
921921
action="store_true",
922922
dest="uc_subprocess",
923-
default=False,
924-
help="""Use undetectable-chromedriver as a subprocess,
923+
default=None,
924+
help="""(DEPRECATED) - Setting will always be enabled.
925+
Use undetectable-chromedriver as a subprocess,
925926
which can help avoid issues that might result.
926927
It may reduce UC's ability to avoid detection.""",
927928
)

seleniumbase/plugins/sb_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ def SB(
401401
undetectable = True
402402
if (
403403
(undetectable or undetected or uc)
404-
and uc_subprocess is None
405-
and uc_sub is None
404+
and (uc_subprocess is None)
405+
and (uc_sub is None)
406406
):
407407
uc_subprocess = True # Use UC as a subprocess by default.
408408
elif (
@@ -414,6 +414,8 @@ def SB(
414414
or "--uc-sub" in sys_argv
415415
):
416416
undetectable = True
417+
if uc_subprocess is None and uc_sub is None:
418+
uc_subprocess = True # Use UC as a subprocess by default.
417419
else:
418420
undetectable = False
419421
if uc_subprocess or uc_sub:

seleniumbase/plugins/selenium_plugin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,9 @@ def options(self, parser, env):
680680
"--uc-sub", # undetected-chromedriver subprocess mode
681681
action="store_true",
682682
dest="uc_subprocess",
683-
default=False,
684-
help="""Use undetectable-chromedriver as a subprocess,
683+
default=None,
684+
help="""(DEPRECATED) - Setting will always be enabled.
685+
Use undetectable-chromedriver as a subprocess,
685686
which can help avoid issues that might result.
686687
It may reduce UC's ability to avoid detection.""",
687688
)

seleniumbase/undetected/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(
5959
version_main=None,
6060
patcher_force_close=False,
6161
suppress_welcome=True,
62-
use_subprocess=False,
62+
use_subprocess=True,
6363
debug=False,
6464
**kw
6565
):
@@ -115,7 +115,7 @@ def __init__(
115115
suppress_welcome: (default: True)
116116
Suppress the Chrome welcome screen that appears on first-time runs.
117117
118-
use_subprocess: (default: False)
118+
use_subprocess: (default: True)
119119
Subprocess chromedriver/python: Don't make Chrome a parent process.
120120
"""
121121
self.debug = debug

0 commit comments

Comments
 (0)