feat: 生产环境用无头浏览器

This commit is contained in:
cheng zhen
2024-12-29 12:54:11 +08:00
parent b604d0cd07
commit 615f406b8e

View File

@@ -29,7 +29,12 @@ class BrowserManager:
co.set_pref("credentials_enable_service", False)
co.set_argument("--hide-crash-restore-bubble")
co.auto_port()
# 只在开发环境启用无头模式
if os.environ.get("ENV") == "development":
co.headless(True)
else:
co.headless(False)
# Mac 系统特殊处理
if sys.platform == "darwin":