Scripted timers must not impose an unannounced time limit
Rule
scripted-timeout· Document, language & navigation · impact serious · Live only (static → incomplete)
Why it matters
A setTimeout/setInterval that will navigate, reload, or submit when it fires is a scripted time limit — the JavaScript twin of a timed : users who read, type, or operate the page slowly (screen-reader, magnifier, motor-impaired users) get cut off mid-task with no warning. Under SC 2.2.1 any time limit must be one the user can turn off, adjust, or extend (a 20-hour-plus limit is exempt, as is a real-time exception). Such timers leave no trace in the DOM, so the engine instruments the live page before its scripts run and records every long timer registration; recorded callbacks whose source performs a navigation ACTION (assigning location, calling location.assign/replace/reload, submitting a form, opening a window — mentions don’t count) between 1 second and 20 hours are reported. The callback source is a heuristic signal, so this is a warning.
How to fix
Remove the automatic redirect/submit, or precede it with an accessible warning that lets the user extend or cancel the limit (per G133/G180: e.g. a confirm dialog offering “I need more time” at least 20 seconds before it fires). Session expiry should re-authenticate without data loss instead of silently discarding the user’s work.
Example
<script>setTimeout(() => { location.href = '/session-expired'; }, 3600000);</script>
<script>let warned = setTimeout(() => { showExtendSessionDialog(); }, 3300000); /* dialog lets the user extend; only an explicit choice navigates */</script>
Live check: the engine records timer registrations on the real page (an init script installed before page scripts run) — static HTML alone is never flagged.
WCAG success criteria
2.2.1 Timing Adjustable — Level A
When a time limit is set by the content, users must be able to turn it off, adjust it, or extend it. An automatic page refresh or timed redirect (meta refresh) is a time limit users cannot control.
Standards
This rule contributes to the following standards:
WCAG A EN 301 549
| Standard | Criteria |
|---|---|
| EN 301 549 | 9.2.2.1 |