fix: avoid template literals in web-probe runner source (#672)
Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
@@ -937,9 +937,9 @@ async function collectProviderCandidates() {
|
||||
const push = (kind, element, value, text) => {
|
||||
const normalizedValue = String(value || "").trim().slice(0, 160);
|
||||
const normalizedText = String(text || "").replace(/\s+/gu, " ").trim().slice(0, 220);
|
||||
const label = `${normalizedValue} ${normalizedText}`.trim();
|
||||
const label = (normalizedValue + " " + normalizedText).trim();
|
||||
if (!label) return;
|
||||
const key = `${kind}:${label}`.toLowerCase();
|
||||
const key = (kind + ":" + label).toLowerCase();
|
||||
if (seen.has(key)) return;
|
||||
seen.add(key);
|
||||
rows.push({ kind, value: normalizedValue, text: normalizedText, testId: String(element?.getAttribute?.("data-testid") || "").slice(0, 120), ariaLabel: String(element?.getAttribute?.("aria-label") || "").slice(0, 160) });
|
||||
@@ -965,7 +965,7 @@ async function collectProviderCandidates() {
|
||||
const text = String(element.textContent || "").replace(/\s+/gu, " ").trim();
|
||||
const ariaLabel = String(element.getAttribute("aria-label") || "");
|
||||
const testId = String(element.getAttribute("data-testid") || "");
|
||||
const haystack = `${text} ${ariaLabel} ${testId}`;
|
||||
const haystack = text + " " + ariaLabel + " " + testId;
|
||||
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);
|
||||
}
|
||||
@@ -3731,8 +3731,8 @@ function finalFlickerScope(sample) {
|
||||
const pathname = samplePathname(sample);
|
||||
const sessionId = sample?.routeSessionId || sample?.activeSessionId || workbenchSessionIdFromPath(pathname);
|
||||
if (!sessionId) return null;
|
||||
if (!pathname.startsWith(`/workbench/sessions/${sessionId}`)) return null;
|
||||
return `${sample?.pageRole || "control"}:${sessionId}`;
|
||||
if (!pathname.startsWith("/workbench/sessions/" + sessionId)) return null;
|
||||
return (sample?.pageRole || "control") + ":" + sessionId;
|
||||
}
|
||||
|
||||
function samplePathname(sample) {
|
||||
|
||||
Reference in New Issue
Block a user