Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions playwright/_impl/_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io
import json
import os
import subprocess
import sys
from abc import ABC, abstractmethod
from pathlib import Path
Expand Down Expand Up @@ -113,6 +114,12 @@ async def connect(self) -> None:
if getattr(sys, "frozen", False):
env.setdefault("PLAYWRIGHT_BROWSERS_PATH", "0")

startupinfo = None
if sys.platform == "win32":
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
startupinfo.wShowWindow = subprocess.SW_HIDE

self._proc = await asyncio.create_subprocess_exec(
str(self._driver_executable),
"run-driver",
Expand All @@ -121,6 +128,7 @@ async def connect(self) -> None:
stderr=_get_stderr_fileno(),
limit=32768,
env=env,
startupinfo=startupinfo,
)
except Exception as exc:
self.on_error_future.set_exception(exc)
Expand Down