mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-26 00:07:25 +01:00
web: static probe no longer counts spoken labels
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f73d2fa513
commit
5b31b19ea7
@ -1,6 +1,5 @@
|
|||||||
// Textgate check over the built site: list every chrome word a page paints
|
// Textgate check over the built site: list every chrome word a page paints
|
||||||
// before its custom elements hydrate (layout, page heads, command-button
|
// before its custom elements hydrate (layout, page heads). Spoken-only text (.sr-only, aria-hidden, the focus-only skip link)
|
||||||
// labels). Spoken-only text (.sr-only, aria-hidden, the focus-only skip link)
|
|
||||||
// is ignored. Exit 1 when any page paints a word, so it works as a gate.
|
// is ignored. Exit 1 when any page paints a word, so it works as a gate.
|
||||||
//
|
//
|
||||||
// Usage: node scripts/visible_words.mjs [distDir] (run `pnpm build` first)
|
// Usage: node scripts/visible_words.mjs [distDir] (run `pnpm build` first)
|
||||||
@ -31,11 +30,8 @@ export function visibleWords(html) {
|
|||||||
const t = n.textContent?.trim() ?? ''
|
const t = n.textContent?.trim() ?? ''
|
||||||
if (WORD_RE.test(t)) out.push(t)
|
if (WORD_RE.test(t)) out.push(t)
|
||||||
}
|
}
|
||||||
// command-button paints its label attribute once it hydrates.
|
// command-button's `label` is spoken only (aria-label) once it hydrates;
|
||||||
for (const el of document.querySelectorAll('command-button[label]')) {
|
// src/test/textgate.commands.guard.test.ts pins that.
|
||||||
const t = el.getAttribute('label') ?? ''
|
|
||||||
if (WORD_RE.test(t)) out.push(`[button] ${t}`)
|
|
||||||
}
|
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user