fix(chv): 完整 Chromium 检测认 CFT 布局 chrome-linux64
Playwright 1.64.1 下的 chrome-linux64.zip 解压为 chrome-linux64/ chrome,旧检查只认 chrome-linux/chrome:数据盘上 403M 完整版 已装好(含 DEPENDENCIES_VALIDATED)仍报未安装、mount_full 误 回落(2026-11-08 构建 #8 驱动实证)。两种布局都认;驱动安装 步在仍未装好时重试一次(客机慢出口 CDN 30 秒超时是抖动)。
This commit is contained in:
1 parent
9d986becaf
commit
0100ffe207
2 files changed
+21
-5
No files matched your search
@@ -138,22 +138,27 @@ def resolve_profile_dir(env=None, ismount=None):
|
||||
|
||||
def full_chromium_executable(browsers_path=None):
|
||||
"""完整 Chromium 可执行文件路径(数据盘安装目录下),未装返回 None。
|
||||
headless-shell 目录不算。"""
|
||||
headless-shell 目录不算。布局有两种:经典 chrome-linux/chrome,
|
||||
与 CFT(Playwright 1.64.1 下的 chrome-linux64.zip)chrome-linux64/
|
||||
chrome——2026-11-08 构建 #8 驱动实证:装好的是后者,旧检查只认
|
||||
前者而漏判,mount_full 误报未安装。"""
|
||||
base = browsers_path or os.environ.get(
|
||||
"PLAYWRIGHT_BROWSERS_PATH", PLAYWRIGHT_BROWSERS_PATH)
|
||||
for cand in glob.glob(os.path.join(base, "chromium-*")):
|
||||
if os.path.basename(cand).startswith(
|
||||
"chromium_headless_shell"):
|
||||
continue
|
||||
exe = os.path.join(cand, "chrome-linux", "chrome")
|
||||
if os.path.isfile(exe):
|
||||
return exe
|
||||
for sub in ("chrome-linux", "chrome-linux64"):
|
||||
exe = os.path.join(cand, sub, "chrome")
|
||||
if os.path.isfile(exe):
|
||||
return exe
|
||||
return None
|
||||
|
||||
|
||||
def full_chromium_present(browsers_path=None):
|
||||
"""完整 Chromium 是否已装:ms-playwright 下有 chromium-*
|
||||
目录且含 chrome-linux/chrome(headless-shell 目录不算)。"""
|
||||
目录且含 chrome-linux/chrome 或 chrome-linux64/chrome
|
||||
(headless-shell 目录不算)。"""
|
||||
return full_chromium_executable(browsers_path) is not None
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user