Skip to content

Commit 51a4b03

Browse files
authored
Update cross-origin resource access instructions
Clarified requirements for cross-origin isolation and resource embedding.
1 parent 1dbba9f commit 51a4b03

File tree

1 file changed

+16
-3
lines changed
  • files/en-us/web/security/practical_implementation_guides/corp

1 file changed

+16
-3
lines changed

files/en-us/web/security/practical_implementation_guides/corp/index.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,27 @@ Instruct browsers to disallow cross-origin requests made in `no-cors` mode:
3737
Cross-Origin-Resource-Policy: same-origin
3838
```
3939

40-
Instruct browsers to allow cross-origin resource access, including access to features with unthrottled timers (such as {{jsxref("SharedArrayBuffer")}} objects or {{domxref("Performance.now()")}}):
40+
To enable {{jsxref("SharedArrayBuffer")}} and {{domxref("Performance.now()")}}, the document must be cross-origin isolated environment. Include the following headers on the document:
4141

4242
```http
43-
Cross-Origin-Resource-Policy: same-origin
43+
Cross-Origin-Opener-Policy: same-origin
4444
Cross-Origin-Embedder-Policy: require-corp
4545
```
4646

47-
This also permits such resources to be embedded.
47+
A page using `Cross-Origin-Embedder-Policy`: `require-corp` may only load resources that explicitly allow being embedded.
48+
Resources can opt in using either:
49+
50+
**Cross-Origin-Resource-Policy (CORP):**
51+
```http
52+
Cross-Origin-Resource-Policy: cross-origin
53+
```
54+
**or CORS:**
55+
56+
```http
57+
Access-Control-Allow-Origin: https://example.com
58+
```
59+
60+
CORP and CORS do not themselves enable SharedArrayBuffer they only allow resources to be loaded under COEP so that isolation is maintained.
4861

4962
## See also
5063

0 commit comments

Comments
 (0)