- ACCESSIBILITY.md (+ docs/i18n/vi): goal (WCAG 2.2 AA, not a conformance
claim), what works with a keyboard, screen readers, zoom, motion and touch,
how it is checked, supported environments, known limitations, how to
report a barrier (severity, response), and a checklist for contributors.
- In the Legal Center (consent: false, English + Vietnamese) and as
/legal/accessibility on the website; the Turnstile page's footer links it
in all eight languages.
- .github: Accessibility barrier issue form (label `accessibility`), an
Accessibility option in the feature request scope, an accessibility
checklist in the PR template.
- README, CONTRIBUTING, DEVELOPMENT (+vi), FEATURES and CLAUDE.md point to
it; SECURITY.md's supported versions move from 1.3.x to 1.5.x.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Regexes with super-linear backtracking (S8786 x16) are rewritten to stay
linear on long runs; each new pattern gives the same results as the old one
on 150k-450k fuzzed inputs (except where noted) and finishes adversarial
50k-character inputs in under 3 ms:
- tag-generator QUALIFIER_SUFFIX_RE starts just before a `:`/space run
(`(^|[^:\s])…` + "$1"), never inside one
- timeline-parser matches `line.trimEnd()` with a greedy label, and renders
with trimEnd(); cleanCpuName collapses whitespace before the patterns
- editor-store endings, Google Play urlPattern (lookahead for `id=`),
channel-phrase punctuation, SPDX OR/AND split, legal-docs slug and link
stripping (link text/URL may not contain `[`), base64url padding, and a
loop for trailing slashes in the worker router
Others:
- S2871: sorts take the shared code-unit comparator (same order as before;
THIRD_PARTY_NOTICES is unchanged)
- S4822: ErrorBoundary catches the logger import with .catch(), which a
try/catch never could
- S3516: migrateProfilesState returns a new object
- S7773: Number.parseInt (x10)
- S9379: Modal takes an initialFocusRef (Radix onOpenAutoFocus), so the
shortcut search box gets focus without an autoFocus attribute
- S2245: generateId drops the Math.random fallback; getRandomValues exists
everywhere the app runs, and a non-random ID is worse than an error
- S4036: NOSONAR on the dev script's `git` call (PATH lookup by design)
- S6505/S8543: every workflow installs with `npm ci --ignore-scripts`, and CI
runs `npm run cf:check` instead of `npx wrangler …`
- S6358: Android sets allowBackup="false" — app data is no longer copied to
Google Drive backups; Backup & Restore moves it to a new phone
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every notice already says 2026, which is right: the first commit is from
2026-04-07, so there is no 2025 to fix and no 2025-2026 range to claim.
What was missing is anything keeping the years current.
- src/config/brand.ts: COPYRIGHT_START_YEAR and copyrightYears(), "2026"
now and "2026-2027" from the first commit made in 2027
- npm run check:copyright (CI, next to check:licenses) holds NOTICE,
REUSE.toml and the installers' copyright string to HEAD's commit year,
not the clock, so old commits stay green; npm run update:copyright
rewrites them
- tauri.conf.json gains bundle.copyright, so the .exe/NSIS, macOS and
Linux packages stop shipping an empty copyright field
- the /legal pages' footer prints the same range at build time
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodeQL flagged the `<[^>]+>` replace in slugify as incomplete multi-character
sanitisation. The character filter after it already reduced anything that is
not a letter or digit to a hyphen, so no markup could survive; drop the regex
and let that one rule do the work.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Worker (worker/) now sits in front of the static build, configured from the
same wrangler.jsonc. Cloudflare builds and deploys it; nothing in GitHub
Actions does.
Gate
- First visit shows a branded check page (8 languages, Accept-Language) with
Cloudflare Turnstile. The token is verified server-side against
TURNSTILE_SECRET: success, hostname, action "enter", age <= 300 s. Only
Cloudflare's own test-key results skip the hostname/action check, so
`npm run cf:dev` works with the published test keys.
- Pass -> `__Host-ytg_gate` (HttpOnly, Secure, SameSite=Lax, 24 h): an HMAC
over expiry + a user-agent hash, keyed from the Turnstile secret, so no
second secret exists and a cookie copied into a scraper is useless.
- The page reloads in place instead of redirecting, so there is no `next`
parameter to open-redirect with; /__gate/status lets the page tell a
cookie-blocking browser what is wrong instead of looping; after one
failure it waits for a click rather than resubmitting.
- Missing secret = deployment mistake: the site stays up without the gate and
the Worker logs it, instead of locking every visitor out.
- The agree box on the gate records `ytg_terms`, which the app reads on boot
so web visitors meet one blocking screen, not two.
Headers and static files
- worker/headers.ts sets CSP (nonce + strict-dynamic on the gate, no script
at all on legal pages), nosniff, Referrer-Policy, Permissions-Policy, COOP,
CORP, X-Frame-Options on everything the Worker returns; _headers covers
the files served directly; a test keeps the two baselines identical.
- `not_found_handling: "404-page"` (a static 404.html) instead of the SPA
fallback, which would have handed index.html past the gate for any
excluded path. The Worker serves the shell itself by fetching "/" - not
"/index.html", which html_handling would 307 back to the home page.
- security.txt (RFC 9116) is generated per build so Expires stays ~6 months
ahead; the Web Analytics beacon is injected into the web build only.
- theme-init.js applies the saved theme before first paint (no inline script).
Legal in-site
- build-plugins/legal-docs.ts renders TERMS, PRIVACY, DISCLAIMER (+ vi),
LICENSE, THIRD_PARTY_NOTICES, SECURITY, NOTICE and CODE_OF_CONDUCT at build
time into static /legal pages (public, before the gate) and a lazy
`virtual:legal-docs` module for the in-app Legal Center, which works
offline on desktop and Android and never leaves the webview.
- PRIVACY, TERMS and SECURITY rewritten for Cloudflare hosting, Turnstile,
Web Analytics and the two cookies; contacts moved to the poli0981.dev
aliases (privacy@, legal@, dmca@, copyright@, security@, code@).
- CURRENT_TERMS_VERSION 1 -> 2: the Privacy Policy changed materially.
App
- Web uses BrowserRouter (real paths; analytics can count them), Tauri keeps
HashRouter; old /#/x bookmarks are rewritten to /x before the router reads
them. Consent is a layout route; /legal sits outside it.
- <html lang> follows the UI language; a stale chunk after a deploy triggers
one reload instead of an error page.
.gitattributes pins LF everywhere so Windows checkouts stop failing Prettier.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>