Opens in a new tab

Cross-Origin-Opener-Policy (COOP), with COEP and CORP

Cross-Origin-Opener-Policy keeps your page in its own browsing context group, so a window it opens — or a site that opened it — cannot reach into it. With Cross-Origin-Embedder-Policy it makes a page cross-origin isolated, which some powerful browser features require. Sites with sign-in or payment popups need the popup-friendly value.

Defined inThe HTML Standard
Valuesunsafe-none, same-origin, same-origin-allow-popups, noopener-allow-popups
Works overHTTPS only — ignored over HTTP
Browser supportChrome 83, Firefox 79, Safari 15.2

Check Cross-Origin-Opener-Policy on your site

Enter a domain: we fetch its homepage and read every security header, this one first.

What it does

A page that opens another, or is opened by one, normally keeps a reference to it — window.opener — which cross-site leak attacks use to learn about a page they cannot read. COOP same-origin cuts that link for anything not from your origin.

Cross-Origin-Embedder-Policy (COEP) is the companion: require-corp lets the page load a cross-origin resource only if it agrees, through Cross-Origin-Resource-Policy (CORP) or CORS, and credentialless loads such resources without cookies instead. COOP same-origin plus a COEP makes the page cross-origin isolated, which is what SharedArrayBuffer and precise timers need.

Directives and values

Directive or valueWhat it does
unsafe-noneThe default: shares its browsing context with whoever opened it.
same-originShares only with same-origin pages that also send same-origin. Needed for cross-origin isolation.
same-origin-allow-popupsLike same-origin, but popups it opens keep their link — for OAuth and payment popups.
noopener-allow-popupsAlways opens in a new group, even for same-origin pages.
COEP: require-corp / credentiallessCross-origin resources must opt in with CORP or CORS — or are loaded without cookies.
CORP: same-site / same-origin / cross-originWho may load this resource in no-cors mode. Values are case-sensitive.

What to send

Cross-Origin-Opener-Policy: same-origin

If the site signs people in or takes payments through a popup, send same-origin-allow-popups instead: same-origin breaks those popups. Only add COEP if you need cross-origin isolation, and try Cross-Origin-Embedder-Policy-Report-Only first — it blocks third-party images, scripts and frames that have not opted in.

How to set it

Apache

Header always set Cross-Origin-Opener-Policy "same-origin"

In the virtual host or .htaccess; needs mod_headers (and AllowOverride FileInfo for .htaccess). always also covers error pages and redirects, which plain Header set skips.

nginx

add_header Cross-Origin-Opener-Policy "same-origin" always;

In the server block. A location with any add_header of its own drops every add_header from the server block — repeat them there, or from nginx 1.29.3 use add_header_inherit merge;.

IIS (web.config)

<system.webServer>
  <httpProtocol>
    <customHeaders>
      <add name="Cross-Origin-Opener-Policy" value="same-origin" />
    </customHeaders>
  </httpProtocol>
</system.webServer>

Caddy

header Cross-Origin-Opener-Policy "same-origin"

Cloudflare

Rules → Overview → Create rule → Response Header Transform Rule
Set static — header name: Cross-Origin-Opener-Policy — value: same-origin

On every plan, for records that are proxied through Cloudflare. Set replaces the header if your server already sends one.

WordPress

add_action( 'send_headers', function () {
	header( 'Cross-Origin-Opener-Policy: same-origin' );
} );

In a small plugin or the theme’s functions.php. PHP only runs for pages WordPress builds, so images, scripts and other static files do not get the header — set it at the server or CDN to cover everything.

Common mistakes

  • same-origin on a site with OAuth or payment popups, which stop working.
  • COEP require-corp while third-party resources lack CORP or CORS — they are blocked.
  • Sending a header twice (server and application): a duplicated COEP falls back to unsafe-none.
  • Testing over plain HTTP, where COOP and COEP are ignored.

What we recommend

Send same-origin, or same-origin-allow-popups for sites with sign-in or payment popups. OWASP recommends same-origin for COOP, require-corp for COEP and same-site for CORP — add the last two only when you have checked what they block.

Questions

Do I need COEP and CORP too?

Only for cross-origin isolation — SharedArrayBuffer and high-precision timers. COOP on its own already protects against popups and openers reaching into the page.

Sources

Checked on 25 September 2026 against these official sources:

Know when a header disappears

Add your domain and we scan it on a schedule — security headers, certificate, HTTPS, DNS and email — and email you when a security header is removed, a certificate changes or HTTPS stops redirecting. Free for your first domain.

Create a free account