From 615f406b8ef924c35e754d006089e71b964322a7 Mon Sep 17 00:00:00 2001 From: cheng zhen Date: Sun, 29 Dec 2024 12:54:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E7=94=A8=E6=97=A0=E5=A4=B4=E6=B5=8F=E8=A7=88=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- browser_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/browser_utils.py b/browser_utils.py index a4f212b..822655b 100644 --- a/browser_utils.py +++ b/browser_utils.py @@ -29,7 +29,12 @@ class BrowserManager: co.set_pref("credentials_enable_service", False) co.set_argument("--hide-crash-restore-bubble") co.auto_port() - co.headless(True) + + # 只在开发环境启用无头模式 + if os.environ.get("ENV") == "development": + co.headless(True) + else: + co.headless(False) # Mac 系统特殊处理 if sys.platform == "darwin":