Require meta refresh to have 0 second delay
- Rule ID:
- meta-refresh
- Category:
- Accessibility
- Standards:
- WCAG 2.2 (A)
- WCAG 2.1 (A)
- WCAG 2.0 (A)
The <meta http-equiv="refresh" content="..">
directive can be used to refresh or redirect the page.
For users with assistive technology a forced refresh or redirect after a fixed duration can render the user unable to read and understand the content in time.
Generally the directive should be avoided all together but under some situations it is unavoidable (e.g. a static page generator hosted on git-based hosting solutions don't provide an alternative for server-based redirection are forced to use client-side redirection).
WCAG H76 requires the interval to be set to exactly 0 as to do theredirection before any content is rendered to the client.
This rule prevents non-zero time intervals and using the directive to refresh the page as it would be stuck in an infinite loop refreshing the same page over and over again.
Rule details
Examples of incorrect code for this rule:
<meta http-equiv="refresh" content="5;url=target.html">
<meta http-equiv="refresh" content="0">
Examples of correct code for this rule:
<meta http-equiv="refresh" content="0;url=target.html">
Options
This rule takes an optional object:
{
"allowLongDelay": false
}
allowLongDelay
- type:
boolean
- default:
false
Delays longer than 20 hours is exempt from WCAG Success Criterion 2.2.1 Timing Adjustable.
By enabling this option the refresh delay can be set to a value greater than 72000
.
With this option disabled:
<meta http-equiv="refresh" content="72001">
With this option enabled:
<meta http-equiv="refresh" content="72001">
References
- WCAG Success Criterion 2.2.1: Timing Adjustable (A)
- WCAG Success Criterion 2.2.4: Interruptions (Level AAA)
- WCAG Success Criterion 3.2.5: Change on Request (Level AAA)
- WCAG H76: Using meta refresh to create an instant client-side redirect
- WCAG G110: Using an instant client-side redirect
Version history
- 8.14.0 -
allowLongDelay
option added.