Skip to main content
WCAGrules
Quick navigation

Do not spawn new windows on page load

F52 is a documented failure, so it names something to take out rather than something to add. The pattern is a window that opens the moment the page loads, before the user has done anything. There is a condition inside it that decides whether the finding stands, and it is missing from most write-ups. The technique is about windows that automatically take focus. A pop-under that opens behind the current window without stealing focus is outside what F52 describes, though it is still a change nobody asked for. So the check has two parts, in this order. Does a new window open, and does it take focus. The repair is to make the window something the user chooses, with a link that says where it goes and what it will do.

How we find it in an audit

Reviewers load the page and touch nothing, then note anything that opened and where focus ended up. Both halves get recorded, because a window that opens without taking focus is a different and smaller finding than one that grabs it. Automated tools can find window.open inside a load handler, which catches the honest cases and misses anything injected by a tag manager or an advertising script. So we also load the page with everything switched on, and watch.

How affected users experience it

A screen reader user starts reading your page, and mid-sentence the software is reading a different page they never opened. There is no announcement, because a new window is not a change within the document, so the only clue is that the words stopped making sense. Getting back means knowing the window-switching command, which many people do not, and which nothing on either page tells them. Someone using a magnifier may not see the new window at all, since it opened outside the region they are looking at, so their page has simply stopped responding.

Passes vs. fails

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

Passes

<a href="/survey" target="_blank">Take our two-minute survey (opens in new tab)</a>

Fails

window.addEventListener("load", function () {
  window.open("/survey", "_blank");
});

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 F52: Failure of Success Criterion 3.2.5 due to opening a new window as soon as a new page is loaded. 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