feat: 启用无头浏览器

This commit is contained in:
cheng zhen
2024-12-29 18:19:18 +08:00
parent 615f406b8e
commit 1c7e9ac79a

View File

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