Skip to content

Lesson 5 of 9 · 25m

COOP, COEP, and CORP: Cross-Origin Isolation Without the Mythology

What crossOriginIsolated really means, how resource loading changes under COEP, and how to adopt isolation without breaking embeds.

Spectre made precise timers scary, browsers reacted by disabling powerful primitives, and then the platform gave us a bargain: explicitly isolate your browsing context and you may use SharedArrayBuffer, high-resolution timers, and certain measurement APIs again. That bargain is cross-origin isolation.

The end state

crossOriginIsolated === true

You normally get there with two headers on the top-level document:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

COOP separates your page from other browsing context groups. window.opener relationships are severed across origins, popup references become limited, and cross-origin windows can no longer poke at each other through legacy DOM handles.

COEP is the louder breaking change: every subresource must either be same-origin, explicitly opt in with CORS, or carry a matching Cross-Origin-Resource-Policy response header.

CORP is the resource's answer

Cross-Origin-Resource-Policy: same-origin
Cross-Origin-Resource-Policy: same-site
Cross-Origin-Resource-Policy: cross-origin

CORP is set by the resource server. It tells browsers which sites may embed that resource. A public CDN asset intended for broad embedding commonly sends cross-origin. Internal avatars or reports should usually be same-origin or same-site.

Under COEP: require-corp, this image fails unless the CDN cooperates:

<img src="https://cdn.vendor.example/widget.png">

The fix is one of:

Cross-Origin-Resource-Policy: cross-origin

or proper CORS plus the corresponding attribute:

<img src="https://cdn.vendor.example/widget.png" crossorigin>

The practical adoption sequence

  1. Inventory third-party scripts, images, fonts, iframes, and worker dependencies.
  2. Add Cross-Origin-Embedder-Policy-Report-Only: require-corp where supported and collect violations.
  3. Ask vendors for CORP/CORS support; proxy assets you control or must guarantee.
  4. Deploy COEP: credentialless-in-no-cors if anonymous no-CORS resources are the remaining blocker.
  5. Finish with require-corp once the report volume is real, not merely low on a quiet day.

credentialless-in-no-cors is not a license to ignore the problem. It strips credentials from anonymous cross-origin no-CORS requests so public resources can load without CORP, but credentialed and CORS-mode requests still need correct participation.

Field notes

  • CORP is not CORS. CORS controls read access to responses; CORP controls embeddability. Many resources need both decisions made deliberately.
  • SharedArrayBuffer availability is a symptom, not the goal. Do not isolate an application just because the property sounded useful.
  • Authentication popups and OAuth redirects can break when COOP severs opener relationships. Test sign-in flows in real browser windows, not just curl.
  • Third-party iframes need their own COEP story; embedding a non-isolated document inside an isolated one has nuanced constraints that vary by browser version.

Was this lesson helpful?

Sign in to rate