Dostępność

a11y/no-meta-refresh

No meta refresh reloads or redirects the page after a delay; redirect on the server or let people choose.

poważnastatyczneWCAG 2.2.1 · Afe-a11y-core

Dlaczego

A timed refresh moves the page away while someone is still reading it or filling it in, and sends screen reader users back to the top. People who read slowly lose their place every time.

Poprawka

Redirect with an HTTP 301 or 308 from the server (or an instant content="0; url=…" where the host allows nothing else). For live data, update the part that changes with script and a polite live region, and offer a pause.

Przykłady

<!-- bad -->
<meta http-equiv="refresh" content="30">
<!-- good: a server redirect, or a link the person follows -->
<p>This page has moved to <a href="/new">the new address</a>.</p>

Źródła

Fakty

Identyfikator
a11y/no-meta-refresh
Waga
poważna
Sprawdzanie
statyczne sprawdzane w kodzie źródłowym przez audit
Dotyczy plików
html angular vue svelte astro jsx
WCAG 2.2
2.2.1, poziom A
Ten sam problem w
axe-core meta-refresh, Lighthouse meta-refresh
Uczy jej skill
fe-a11y-core Accessibility, WCAG 2.2 map
Od wersji
0.1.0

Plik reguły na GitHubie

Przeczytaj w terminalu

npx github:dawidolko/frontend-skills explain a11y/no-meta-refresh