DevTools Logo

Cross-Origin Isolation Header Builder

Cross-Origin Isolation Header Builder

Generate COOP, COEP and CORP headers for SharedArrayBuffer and WASM threads.

Runs in your browser
crossOriginIsolated: expected true
Try an example

Directives

3 headers

Controls window.opener sharing. same-origin isolates; allow-popups keeps OAuth popups working.

require-corp needs CORP/CORS on subresources; credentialless loads no-cors resources without credentials.

Deployment checklist

  • Add crossorigin to <script>, <img> and <link> tags fetching cross-origin resources, or ensure those servers send Access-Control-Allow-Origin / CORP.
  • Check classic worker scripts used by WASM pthreads — no-cors workers are blocked under require-corp; serve them with CORP or use CORS.
  • Opaque (no-cors) images and service-worker cached opaque responses will break — switch to CORS mode or proxy them.
  • Verify deployment over HTTPS (or localhost): self.crossOriginIsolated in the browser console should be true when enforced headers ship.
  • Confirm the headers are present on every response, including static assets and error pages (nginx: add_header inheritance trap).

Verify

// Browser console
self.crossOriginIsolated // true when isolation is active
typeof SharedArrayBuffer // "function" when available
curl -sI https://example.com | grep -iE 'cross-origin-(opener|embedder)-policy'

Output

headers · 3 headers
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Resource-Policy: same-origin
  • require-corp: cross-origin subresources must send CORP or be loaded with CORS (crossorigin attribute); no-cors images, classic worker scripts and opaque service-worker responses will fail.

Pick COOP, COEP and CORP directive values and immediately see whether crossOriginIsolated is achievable — including secure-context and report-only caveats. The tool emits copy-ready header lists plus nginx, Apache, Caddy, Express, Netlify and Vercel snippets from one source of truth, with a deployment checklist covering CORS, worker scripts, opaque responses and console verification.

Examples

Enable WASM threads

Input
COOP same-origin, COEP require-corp, CORP same-origin
Output
crossOriginIsolated expected true

All three headers ship on every response and subresources are loaded with CORS or carry CORP.

Keep third-party images

Input
COOP same-origin, COEP credentialless
Output
no CORP required on third-party hosts

credentialless removes ambient credentials from no-cors subresources instead of requiring CORP headers from their owners.

Safe rollout

Input
COEP Report-Only enabled
Output
Cross-Origin-Embedder-Policy-Report-Only: require-corp

Violations are reported before enforcement, but the verdict stays false until the enforcing header is shipped.

About this tool

Cross-origin isolation is the browser state that unlocks SharedArrayBuffer, high-resolution timers and WASM threading. It requires a specific pair of response headers: a non-unsafe Cross-Origin-Opener-Policy (COOP) plus a Cross-Origin-Embedder-Policy (COEP) of require-corp or credentialless. This builder lets you choose the directives, immediately see whether isolation is expected, and emit the headers in the syntax your server needs.

The verdict is modeled, not guessed: report-only variants never grant isolation, unsafe-none combinations never do, and a non-secure context (plain HTTP away from localhost) blocks isolation even with perfect headers. Popup-compatible COOP values are marked with their tradeoff — OAuth popups keep window.opener access but cannot share isolated memory — and require-corp's subresource duties are spelled out in a deployment checklist.

One header map drives every output: a plain header list, nginx add_header lines with the always flag and an inheritance warning, Express res.setHeader calls, a Netlify _headers block, a Vercel vercel.json headers array, Apache Header always set and Caddy header directives. Report-to tokens are validated so a stray quote or newline cannot corrupt a generated config, and an optional curl command helps verify what actually shipped.

What this tool does not do

  • The verdict predicts the expected state; only self.crossOriginIsolated in the target browser after deployment is authoritative.
  • Subresource compliance (CORP/CORS, worker scripts, opaque responses) depends on your deployment and cannot be audited from this builder.
  • COEP credentialless and newer COOP values have uneven browser support — check your target matrix before relying on them.

How to use this tool

  1. Choose a preset or directives

    Start with WASM threads, third-party embeds, report-only rollout or off — or tune COOP, COEP and CORP yourself.

  2. Read the verdict

    The green verdict means isolation is expected; amber lists the exact reason it is not, including secure-context and report-only caveats.

  3. Pick an output syntax

    Switch tabs between headers, nginx, Express, Netlify, Vercel, Apache and Caddy, then copy or download the result.

  4. Follow the checklist

    Check CORS/CORP on subresources, classic worker scripts and opaque responses, then confirm with self.crossOriginIsolated in the console.

Use cases

WASM threading

Generate the exact header trio that makes SharedArrayBuffer available for pthread-enabled WebAssembly apps.

Site-wide hardening

Roll COOP/COEP out across an origin with nginx, Apache or Vercel config and a checklist for every subresource.

Debugging SAB undefined

Check report-only mode, secure context and CORP coverage — the three most common reasons crossOriginIsolated stays false in production.

Directive values that matter

HeaderValue
COOPsame-origin
COOPsame-origin-allow-popups
COOPunsafe-none
COEPrequire-corp
COEPcredentialless
CORPsame-origin / same-site / cross-site
*-Report-Onlysame directives

Isolation is expected only when COOP and COEP are both enforcing and non-unsafe, and the page is a secure context.

Common mistakes

Mistake:Shipping only Cross-Origin-Embedder-Policy and expecting SharedArrayBuffer.

Fix:Both COOP and COEP are required, both must be enforcing, and the page must be a secure context.

Mistake:Believing report-only headers grant isolation.

Fix:The -Report-Only variants only report violations; the builder's verdict stays false until you switch to enforcing headers.

Mistake:Adding add_header COOP/COEP only in the nginx server block.

Fix:A location block with any add_header of its own drops inherited headers — repeat the isolation headers inside every such location.

Frequently asked questions

Why is SharedArrayBuffer undefined on my site?

Usually one of three things: the COOP/COEP pair is missing or one value is unsafe-none, one of the headers is still in -Report-Only mode, or the page is not a secure context (plain HTTP away from localhost). Even with perfect headers, cross-origin subresources that neither carry CORP nor are loaded with CORS can break the isolated context. Check self.crossOriginIsolated in the console after each fix.

What's the difference between require-corp and credentialless?

require-corp blocks cross-origin subresources unless the server sends a Cross-Origin-Resource-Policy header or the resource is loaded with CORS. credentialless instead loads no-cors subresources without credentials, so third-party hosts that cannot add CORP headers still work. credentialless has less complete browser support, so feature-detect it before depending on it.

Can I use crossOriginIsolated with OAuth popups?

Yes, with a tradeoff. COOP same-origin-allow-popups preserves window.opener access for popups while still enabling isolation for the opener, but those popups are not themselves isolated and cannot share SharedArrayBuffer with the opener. Full same-origin COOP severs that relationship and can break popup-based OAuth flows.

Do my subresources need CORP?

Under require-corp, yes: cross-origin scripts, images, workers and fetches must either be served with Cross-Origin-Resource-Policy or loaded with CORS (for example the crossorigin attribute on script/img tags). Classic worker scripts used by WASM pthreads are fetched no-cors by default and need special attention. Under credentialless, no-cors responses load without credentials instead.

What is report-only mode?

Sending Cross-Origin-Opener-Policy-Report-Only or Cross-Origin-Embedder-Policy-Report-Only reports what would be blocked without enforcing the policy. It is how you safely roll headers out in stages — but report-only headers grant zero isolation. The builder's verdict reflects this and stays false until enforcing headers ship.

How do I verify the headers actually shipped?

In the browser console, self.crossOriginIsolated should be true and typeof SharedArrayBuffer should be function. From a shell, curl -sI https://your-site | grep -i cross-origin shows the response headers. Remember nginx's add_header inheritance trap: a location block with its own add_header drops headers declared only at server level.

References & standards