Skip to content

Commit 9f330c4

Browse files
committed
Prevent duplicate virtual displays
1 parent dc75ab1 commit 9f330c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

seleniumbase/undetected/cdp_driver/cdp_util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,11 @@ async def start(
565565
platform_var = platform_var[1:-1]
566566
if IS_LINUX and not headless and not headed and not xvfb:
567567
xvfb = True # The default setting on Linux
568-
__activate_virtual_display_as_needed(headless, headed, xvfb, xvfb_metrics)
568+
if not host or not port:
569+
# The browser hasn't been launched yet. (May need a virtual display)
570+
__activate_virtual_display_as_needed(
571+
headless, headed, xvfb, xvfb_metrics
572+
)
569573
if proxy and "@" in str(proxy):
570574
user_with_pass = proxy.split("@")[0]
571575
if ":" in user_with_pass:

0 commit comments

Comments
 (0)