From ce4f373656c40014a3ffc471f7812b0db9d19461 Mon Sep 17 00:00:00 2001 From: Lyon <88232613+pikasTech@users.noreply.github.com> Date: Mon, 22 Jun 2026 18:43:53 +0800 Subject: [PATCH] fix: scan provider candidates inside browser context (#675) Co-authored-by: Codex --- scripts/src/hwlab-node-web-observe-runner-source.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/src/hwlab-node-web-observe-runner-source.ts b/scripts/src/hwlab-node-web-observe-runner-source.ts index 474f73cd..9371f668 100644 --- a/scripts/src/hwlab-node-web-observe-runner-source.ts +++ b/scripts/src/hwlab-node-web-observe-runner-source.ts @@ -929,6 +929,12 @@ async function collectProviderCandidates() { return page.evaluate(() => { const rows = []; const seen = new Set(); + const isNavigationLabel = (value) => { + const label = String(value || "").replace(/\s+/gu, " ").trim().toLowerCase(); + if (!label) return false; + if (label === "api keys" || label === "kapi keys" || label === "profiles" || label === "rprofiles") return true; + return /^(?:api keys|profiles)$/iu.test(label.replace(/^[a-z]\s*/iu, "")); + }; const visible = (element) => { const rect = element.getBoundingClientRect(); const style = window.getComputedStyle(element); @@ -966,7 +972,7 @@ async function collectProviderCandidates() { const ariaLabel = String(element.getAttribute("aria-label") || ""); const testId = String(element.getAttribute("data-testid") || ""); const haystack = text + " " + ariaLabel + " " + testId; - if (isProviderNavigationLabel(haystack)) continue; + if (isNavigationLabel(haystack)) continue; if (!/provider|profile|model|模型|提供|codex|openai|deepseek|gpt|api|flash|spark|claude|gemini|moon/iu.test(haystack)) continue; push("visible-control", element, element.getAttribute("value") || "", text || ariaLabel || testId); }