--- url: "https://web.dev/articles/coop-coep" titulek: "Make your website \"cross-origin isolated\" using COOP and COEP | Articles | web.dev" h1: "Make your website \"cross-origin isolated\" using COOP and COEP Stay organized with collections Save and categorize content based on your preferences." popis: "Learn how to set up the opt-in-based isolated environment, called cross-origin isolated, with COOP and COEP." jazyk: "en" kanonicka: "https://web.dev/articles/coop-coep" drobecky: ["Articles", "Make your website "cross-origin isolated" using COOP and COEP"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-13 23:11:30" znaku: 14240 slov: 1960 kodovani: "iso-8859-2" sha256: "fa57bb9f27bbdcf3dc853ea29e1b00b57ad7a277b84fb1b137d277244a617009" --- Make your website "cross-origin isolated" using COOP and COEP Stay organized with collections Save and categorize content based on your preferences. *Use COOP and COEP to set up a cross-origin isolated environment and enable powerful features like `SharedArrayBuffer`, `performance.measureUserAgentSpecificMemory()` and high resolution timer with better precision.* Eiji Kitamura Published: April 13, 2020, Last updated: June 21, 2022 This document shows how to use these COOP and COEP. You can read more about why this matters in [Make your website "cross-origin isolated" using COOP and COEP](/articles/why-coop-coep). Some web APIs increase the risk of side-channel attacks like Spectre. To mitigate that risk, browsers offer an opt-in-based isolated environment called cross-origin isolated. With a cross-origin isolated state, the webpage will be able to use privileged features including: API Description [`SharedArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) Required for WebAssembly threads. This is available from Android Chrome 88. Desktop version is enabled by default with the help of [Site Isolation](https://www.chromium.org/Home/chromium-security/site-isolation), but will require the cross-origin isolated state and [will be disabled by default in Chrome 92](https://developer.chrome.com/blog/enabling-shared-array-buffer). [`performance.measureUserAgentSpecificMemory()`](/articles/monitor-total-page-memory-usage) Available from Chrome 89. [`performance.now()`, `performance.timeOrigin`](https://crbug.com/1180178) Available in many browsers, with resolution limited to 100 microseconds or higher. With cross-origin isolation, the resolution can be 5 microseconds or higher. Features that will be available behind cross-origin isolated state. The cross-origin isolated state also prevents modifications of `document.domain`. (Being able to alter `document.domain` allows communication between same-site documents and has been considered a loophole in the same-origin policy.) To opt in to a cross-origin isolated state, you need to send the following HTTP headers on the main document: `Cross-Origin-Embedder-Policy: require-corp Cross-Origin-Opener-Policy: same-origin` These headers instruct the browser to block loading of resources or iframes which haven't opted into being loaded by cross-origin documents, and prevent cross-origin windows from directly interacting with your document. This also means those resources being loaded cross-origin require opt-ins. You can determine whether a web page is in a cross-origin isolated state by examining [`self.crossOriginIsolated`](https://developer.mozilla.org/docs/Web/API/WindowOrWorkerGlobalScope/crossOriginIsolated). Glossary This document uses many similarly named and abbreviated terminology. To clarify, we've curated a mini glossary: [COEP: Cross Origin Embedder Policy](https://wicg.github.io/cross-origin-embedder-policy/) [COOP: Cross Origin Opener Policy](https://github.com/whatwg/html/pull/5334/files) [CORP: Cross Origin Resource Policy](https://developer.mozilla.org/docs/Web/HTTP/Cross-Origin_Resource_Policy_(CORP)) [CORS: Cross Origin Resource Sharing](https://developer.mozilla.org/docs/Web/HTTP/CORS) [CORB: Cross Origin Read Blocking](https://www.chromium.org/Home/chromium-security/corb-for-developers) Make your website cross-origin isolated 1. Set `Cross-Origin-Opener-Policy: same-origin` on the top-level document By enabling `COOP: same-origin` on a top-level document, windows with the same origin and windows opened from the document have a separate browsing context group, unless they are in the same origin with the same COOP setting. Thus, isolation is enforced for opened windows and mutual communication between both windows is disabled. A browsing context group is a set of windows that can reference each other. For example, a top-level document and its child documents embedded with `