Skip to main content
WCAGrules
Quick navigation

Do not open windows the user never requested

F22 is a documented failure, so it describes something to remove rather than something to build. The pattern is a window that opens without anybody asking for it, on a timer, on page load, or off the back of an action that meant something else. There is a clear line here and it is easy to draw it too hard. A window the user chose is fine. Opening an options dialog because somebody pressed the button labeled Options is exactly what should happen. The failure is the unexpected one. A link that says it opens in a new tab, and then does, is a request. A timer that opens a promotion three seconds after the page loads is not.

How we find it in an audit

We load the page and watch for a few seconds without touching anything, then activate every link and button in turn and watch again. Both halves matter, because the load-time case and the activation case are separate defects with the same symptom. Where a window does open on purpose, we check that the link text says so in words a person would notice. We deliberately do not accept a title attribute as that warning, since it never reaches keyboard-only or touch-only users.

How affected users experience it

A new window arrives with no announcement. The screen reader user hears content that does not follow from what they were reading, and has to work out from the content alone that they are somewhere else. Then Back stops working, because Back belongs to the window they are no longer in, and the way home is a window-switching command plenty of people have never had to learn. Someone using a magnifier can lose the new window entirely, since it opened outside the small region they are looking at.

Passes vs. fails

Passes: one name, everywhere. Fails: renamed on every page.

Passes

<a href="/promo" target="_blank">Current offers (opens in new tab)</a>
<!-- The user reads what will happen, then chooses it. -->

Fails

setTimeout(function () { window.open("/promo", "_blank"); }, 3000);
// Three seconds after load, a window nobody asked for.

How this gets tested

The W3C publishes test rules that define what a checker looks for here.

The other techniques filed under this rule

16 guides on this site are filed under 3.2.5 Change on Request. W3C documents this one as a failure of that rule, so it describes a way the rule gets broken rather than a way to pass it.

This guide is our interpretation of W3C technique F22: Failure of Success Criterion 3.2.5 due to opening windows that are not requested by the user. W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.

Go somewhere useful

Find tools, resources and your workspace.

29 destinations