SCR24: Warning Users Before Opening New Windows

Jamie
digitalwcagscreen readerskeyboard navigationprogressive enhancementjavascript

Jamie · AI Research Engine

Analytical lens: Strategic Alignment

Small business, Title III, retail/hospitality

AI-assisted · Source-linked · Editorially reviewed · Methodology

Trust note

This article was drafted with AI assistance, reviewed against accessibility.chat editorial standards, and should be treated as research and education rather than legal advice. We prioritize primary sources and correct material errors.

A miniature Statue of Liberty placed on a laptop displaying code, symbolizing freedom in technology.
Photo by hitesh choudhary on Pexels

Why do developers keep opening new windows without telling users — and why does this keep landing on accessibility audits as a repeat finding?

The answer isn't ignorance of the rule. Most developers know that surprise context changes are bad practice. The problem is implementation: teams reach for target="_blank" as a reflex, skip the progressive enhancement step, and ship. The users left disoriented are screen reader users who lose their place in a document, keyboard navigators who suddenly can't find the back button, and people with cognitive disabilities who experience unexpected context shifts as genuinely confusing. This is a solvable problem. WCAG Technique SCR24 (opens in new window) shows exactly how to solve it.

The Technique

SCR24 is an official entry in W3C's WCAG 2.2 techniques catalog (opens in new window) — specifically a client-side scripting technique that addresses how to open new browser windows or tabs on user request without creating surprise. The core principle: if a link will open a new context, the user must be warned before they activate it.

The technique supports Success Criterion 3.2.5: Change on Request (opens in new window) as a sufficient method, and serves as advisory guidance for 2.4.4: Link Purpose (In Context) (opens in new window) and 2.4.9: Link Purpose (Link Only) (opens in new window). That's meaningful: SC 3.2.5 is a Level AAA criterion about giving users control over context changes. Implementing SCR24 correctly is one of the documented paths to satisfying it.

The technique name — "progressive enhancement" — is the key. The link works as a normal HTML link first. JavaScript then enhances it by appending a warning to the visible link text and attaching event handlers.

How It Works

The W3C source material provides a concrete implementation. The markup is intentionally minimal:

HTML
<script src="popup.js"></script>
...
<a href="help.html" id="newwin">Show Help</a>

The link itself has no target attribute. No onclick inline. Just a clean, functional anchor. The script does the work:

JAVASCRIPT
window.onload = addHandlers;
function addHandlers() {
var objAnchor = document.getElementById('newwin');
if (objAnchor) {
// Append warning to visible link text
objAnchor.firstChild.data =
objAnchor.firstChild.data + ' (opens in a new window)';
// Attach both click and keyboard handlers
objAnchor.onclick = function(event) {
return launchWindow(this, event);
};
objAnchor.onkeypress = function(event) {
return launchWindow(this, event);
};
}
}
function launchWindow(objAnchor, objEvent) {
var iKeyCode, bSuccess = false;
// For keyboard events, only open on Return or Space
if (objEvent && objEvent.type == 'keypress') {
if (objEvent.keyCode) iKeyCode = objEvent.keyCode;
else if (objEvent.which) iKeyCode = objEvent.which;
// If not carriage return or space, let the browser handle it
}
// [window.open logic continues...]
}

Three things are happening here that matter:

  1. The link text is modified programmatically — "Show Help" becomes "Show Help (opens in a new window)". Screen readers announce this. Sighted users see it. Everyone gets the same information.
  2. Both click and keyboard events are handled — The W3C source notes explicitly that some browsers don't handle events in a device-independent manner, so both handlers are attached. This isn't optional.
  3. The base link still works without JavaScript — If script fails or is unavailable, href="help.html" loads normally. Progressive enhancement, not JavaScript dependency.

Why This Matters to Real Users

Once again, we're seeing a technique that looks trivial on paper but has real consequences when skipped. Consider what happens without the warning:

Screen reader users hear "Show Help, link" and activate it. A new window opens. Their virtual cursor position in the original document may remain, but the browser focus has moved to the new tab. Depending on the screen reader and browser combination, they may not receive any announcement that context changed. They navigate, get confused, and either close the new window (losing it) or can't find their way back.

Keyboard users face a similar problem. The browser's back button doesn't work in a new tab — there's no history to go back to. A keyboard user who doesn't realize they're in a new context may spend time hunting for how to return.

Users with cognitive disabilities experience unexpected context shifts as disorienting. A new window appearing without warning interrupts their mental model of where they are in a task.

The fix costs almost nothing. The failure to implement it costs users their ability to navigate with confidence.

This connects directly to a broader pattern our research has documented: automated testing catches only a fraction of real accessibility barriers. Our paper Beyond Detection: Why Context Separates Automated Testing from Manual Audits shows that automated tools max out at roughly 37% detection of actual barriers. The presence of a new-window warning in link text is something automated tools can sometimes flag — but whether that warning is accurate, meaningful, and actually announced by assistive technology requires human judgment.

Applying This

For development teams, here's where this technique fits into your workflow:

In code review: Flag any target="_blank" or window.open() call that isn't accompanied by visible text warning the user. The warning must be in the link text itself — not in a tooltip, not in a title attribute, not in a visually hidden span that some screen readers may skip depending on verbosity settings.

In design: If your design system includes external link icons (the classic arrow-out-of-box icon), audit whether those icons have accessible text equivalents. An icon alone doesn't satisfy the requirement. The accessible name of the link must communicate the new-window behavior.

In automated testing: Tools like axe-core can flag links with target="_blank" that lack warning text — but configure your ruleset to catch this. It's not always enabled by default.

Modern implementation note: The W3C example uses older JavaScript patterns (window.onload, objEvent.keyCode). Modern teams should use addEventListener and event.key instead of keyCode, which is deprecated. The principle of SCR24 is what matters; update the implementation pattern to match current standards.

A practical table for your team:

PatternSC ImplicatedCompliant?Fix
target="_blank" with no warning3.2.5, 2.4.4NoAdd visible text warning via SCR24
window.open() with no warning3.2.5, 2.4.4NoAdd event handler + text warning
Link text includes "(opens in new tab)"3.2.5, 2.4.4Yes—
External link icon with aria-label including warning3.2.5, 2.4.4Yes—
title attribute warning only3.2.5, 2.4.4NoTitle not reliably announced

One more dimension teams consistently miss: language access. If your site serves multilingual users — and 25+ million people in the U.S. have limited English proficiency — the warning text "(opens in a new window)" must be translated. Not just the visible page text, but ARIA labels, dynamically injected strings like this one, and form validation messages. idioma.chat (opens in new window) is one of the few tools built to handle exactly this: translating not just static content but the full accessibility layer, including dynamically generated text that scripts like SCR24 inject into the DOM. Accessibility without language access is incomplete accessibility, and this technique is a concrete example of where that gap appears.

CORS Perspective

Through a strategic alignment lens, SCR24 is the kind of technique that exposes a gap between what organizations say they prioritize and what their development workflows actually enforce. The fix is low-cost and well-documented — it's been in the WCAG techniques catalog for years. When it keeps appearing as an audit finding, that's an operational signal: the team lacks either a code review checklist that catches it, a design system component that builds it in by default, or both. As our research on compliance framework challenges shows, organizations often have the right intentions but no systematic mechanism to translate those intentions into consistent implementation. SCR24 is simple enough that getting it right is achievable in a single sprint — making it an ideal quick win for teams trying to demonstrate accessibility progress while building toward more systematic change.

About the Jamie lens

A strategy lens for small business and Title III. Frames findings around cost, sequencing, and what a retail or hospitality operator can realistically act on first.

Jamie is an AI analyst lens, not a human staff member. It helps frame this article through a consistent accessibility perspective.

Specialization: Small business, Title III, retail/hospitality

View all articles using this lens →

Transparency Disclosure

This article was drafted with AI assistance and reviewed against our editorial methodology. We disclose that process so readers can judge the work clearly.