Living Standard â Last Updated 1 September 2026
ãã®ã»ã¯ã·ã§ã³ã¯ããŠã§ããã©ãŠã¶ãŒã«æãçŽæ¥çã«é©çšãããæ©èœã«ã€ããŠèª¬æãããããã§ããã¯ããç¹ã«æå®ããªãéãããã®ã»ã¯ã·ã§ã³ã§å®çŸ©ãããŠããèŠä»¶ã¯ããŠã§ããã©ãŠã¶ãŒã§ãããã©ããã«é¢ãããããã¹ãŠã®ãŠãŒã¶ãŒãšãŒãžã§ã³ãã«é©çšãããã
çæå ã¯ããŠã§ãã®ã»ãã¥ãªãã£ã¢ãã«ã®åºæ¬çãªé貚ã§ãããçæå ãå ±æãããŠã§ããã©ãããã©ãŒã å ã®2ã€ã®åœäºè ãäºãã«ä¿¡é Œããåäžã®æš©éãæãããšä»®å®ããããç°ãªãçæå ããã€åœäºè ã¯ãäºãã«æœåšçã«æªæããããšèŠãªãããäºãããçšåºŠãå€åãããããéé¢ãããã
ããšãã°ãbank.example.comã§ãã¹ããããExample Bankã®ãŠã§ããµã€ãã¯ãcharity.example.orgã§ãã¹ãExample Charityã®ãŠã§ããµã€ãã®DOMãæ€æ»ããããšãããšã"SecurityError" DOMException ãçºçããã
çæå ã¯æ¬¡ã®ããããã§ããïŒ
å
éšå€ã§ãããã·ãªã¢ã©ã€ãºãããŠããªãããã«åäœæããããšãã§ããªãïŒçæå
ã®ã·ãªã¢ã©ã€ãºããšã«"null"ãšããŠã·ãªã¢ã©ã€ãºãããïŒãæå³ã®ããæäœã¯ãééæ§ã®ãã¹ãã®ã¿ã§ããã
A tuple consisting of:
çæå
ã¯ãããšãã°è€æ°ã®Documentãªããžã§ã¯ãéã§å
±æã§ãããããã«ãçæå
ã¯äžè¬ã«äžå€ã§ãããã¿ãã«ã®çæå
ã®ãã¡ã€ã³ã®ã¿ãããã³document.domain APIãä»ããŠã®ã¿å€æŽã§ããã
çæå originã®æå¹ãã¡ã€ã³ã¯ã次ã®ããã«èšç®ãããïŒ
originãäžéæãªçæå ã§ããå Žåãnullãè¿ãã
originã®ãã¡ã€ã³ãnullã§ãªãå Žåãoriginã®ãã¡ã€ã³ãè¿ãã
originã®ãã¹ããè¿ãã
The serialization of an origin is the string obtained by applying the following algorithm to the given origin origin:
If origin is an opaque origin, then return "null".
Otherwise, let result be origin's scheme.
Append "://" to result.
Append origin's host, serialized, to result.
If origin's port is non-null, append a U+003A COLON character (:), and origin's port, serialized, to result.
Return result.
("https", "xn--maraa-rta.example", null, null)ã® ã·ãªã¢ã©ã€ãŒãŒã·ã§ã³ã¯"https://xn--maraa-rta.example"ãšãªãã
There used to also be a Unicode serialization of an origin. However, it was never widely adopted.
Two origins, A and B, are said to be same origin if the following algorithm returns true:
If A and B are the same opaque origin, then return true.
If A and B are both tuple origins and their schemes, hosts, and port are identical, then return true.
falseãè¿ãã
Two origins, A and B, are said to be same origin-domain if the following algorithm returns true:
If A and B are the same opaque origin, then return true.
If A and B are both tuple origins:
If A and B's schemes are identical, and their domains are identical and non-null, then return true.
Otherwise, if A and B are same origin and their domains are both null, return true.
falseãè¿ãã
| A | B | same origin | same origin-domain |
|---|---|---|---|
("https", "example.org", null, null) | ("https", "example.org", null, null) | â | â |
("https", "example.org", 314, null) | ("https", "example.org", 420, null) | â | â |
("https", "example.org", 314, "example.org") | ("https", "example.org", 420, "example.org") | â | â |
("https", "example.org", null, null) | ("https", "example.org", null, "example.org") | â | â |
("https", "example.org", null, "example.org") | ("http", "example.org", null, "example.org") | â | â |
ã¹ããŒã ãšãã¹ãã¯ãã¹ããŒã ïŒASCIIæååïŒããã³ãã¹ãïŒãã¹ãïŒã®ã¿ãã«ã§ããã
ãµã€ãã¯äžéæãªçæå ãŸãã¯scheme-and-hostã§ããã
To obtain a site, given an origin origin, run these steps:
If origin is an opaque origin, then return origin.
If origin's host's registrable domain is null, then return (origin's scheme, origin's host).
Return (origin's scheme, origin's host's registrable domain).
Two sites, A and B, are said to be same site if the following algorithm returns true:
If A and B are the same opaque origin, then return true.
If A or B is an opaque origin, then return false.
If A's and B's scheme values are different, then return false.
If A's and B's host values are not equal, then return false.
Return true.
The serialization of a site is the string obtained by applying the following algorithm to the given site site:
If site is an opaque origin, then return "null".
Let result be site[0].
Append "://" to result.
Append site[1], serialized, to result.
Return result.
It needs to be clear from context that the serialized value is a site, not an origin, as there is not necessarily a syntactic difference between the two. For example, the origin ("https", "shop.example", null, null) and the site ("https", "shop.example") have the same serialization: "https://shop.example".
Two origins, A and B, are said to be schemelessly same site if the following algorithm returns true:
If A and B are the same opaque origin, then return true.
If A and B are both tuple origins:
If hostA equals hostB and hostA's registrable domain is null, then return true.
If hostA's registrable domain equals hostB's registrable domain and is non-null, then return true.
falseãè¿ãã
Two origins, A and B, are said to be same site if the following algorithm returns true:
Let siteA be the result of obtaining a site given A.
Let siteB be the result of obtaining a site given B.
If siteA is same site with siteB, then return true.
falseãè¿ãã
åäžçæå ããã³åäžorigin-domainã®æŠå¿µãšã¯ç°ãªããã¹ããŒã ã¬ã¹ã§åããµã€ãããã³åããµã€ãã®å ŽåãããŒãããã³ãã¡ã€ã³ã³ã³ããŒãã³ãã¯ç¡èŠãããã
URLã§èª¬æãããçç±ã«ãããåäžçæå ãã§ãã¯ãåªå ããŠãå¯èœãªå Žåã¯åããµã€ãããã³ã¹ããŒã ã¬ã¹ã§åããµã€ãã®æŠå¿µãåé¿ãã¹ãã§ããã
wildlife.museumãmuseumãããã³comã¯å
¬éãµãã£ãã¯ã¹ã§ãããexample.comã¯ããã§ã¯ãªãïŒ
| A | B | schemelessly same site | same site |
|---|---|---|---|
("https", "example.com") | ("https", "sub.example.com") | â | â |
("https", "example.com") | ("https", "sub.other.example.com") | â | â |
("https", "example.com") | ("http", "non-secure.example.com") | â | â |
("https", "r.wildlife.museum") | ("https", "sub.r.wildlife.museum") | â | â |
("https", "r.wildlife.museum") | ("https", "sub.other.r.wildlife.museum") | â | â |
("https", "r.wildlife.museum") | ("https", "other.wildlife.museum") | â | â |
("https", "r.wildlife.museum") | ("https", "wildlife.museum") | â | â |
("https", "wildlife.museum") | ("https", "wildlife.museum") | â | â |
("https", "example.com") | ("https", "example.com.") | â | â |
ïŒããã§ã¯ããŒãããã³ãã¡ã€ã³ã®ã³ã³ããŒãã³ãã¯èæ ®ãããŠããªããããçç¥ããŠãããïŒ
document.domain [ = domain ]ã»ãã¥ãªãã£ãã§ãã¯ã®ããã«äœ¿çšãããçŸåšã®ãã¡ã€ã³ãè¿ãã
ãµããã¡ã€ã³ãåé€ããå€ã«èšå®ããçæå ã®ãã¡ã€ã³ã倿Žããåããã¡ã€ã³ã®ä»ã®ãµããã¡ã€ã³ïŒåãããšãè¡ãå ŽåïŒã®ããŒãžãäºãã«ã¢ã¯ã»ã¹ã§ããããã«ããããšãã§ãããããã«ããããã¡ã€ã³ã®ç°ãªããã¹ãäžã®ããŒãžããäºãã®DOMã«åæçã«ã¢ã¯ã»ã¹ã§ããããã«ãªãã
ãµã³ãããã¯ã¹åãããiframeãäžéæãªçæå
ããã€Documentãããã³ãã©ãŠãžã³ã°ã³ã³ããã¹ãã®ãªãDocumentã«ãããŠãã»ãã¿ãŒã¯"SecurityError"äŸå€ãæãããcrossOriginIsolatedãŸãã¯originAgentClusterãtrueãè¿ãå Žåãã»ãã¿ãŒã¯äœãããªãã
document.domainã»ãã¿ãŒã®äœ¿çšãé¿ãããããã¯ãåäžçæå
ããªã·ãŒãæäŸããã»ãã¥ãªãã£ä¿è·ãæãªããã®ã§ãããããã¯å
±æãã¹ãã£ã³ã°ã䜿çšããŠããå Žåã«ç¹ã«é¡èã§ãããããšãã°ãä¿¡é Œã§ããªããµãŒãããŒãã£ãåãIPã¢ãã¬ã¹ã ãç°ãªãããŒãã§ HTTP ãµãŒããŒããã¹ãã§ããå Žåãdocument.domainã»ãã¿ãŒã䜿çšããåŸã«çæå
ãæ¯èŒãããšãã«ããŒããç¡èŠããããããéåžžã¯åããã¹ãäžã®2ã€ã®ç°ãªããµã€ããä¿è·ããåäžçæå
ã®ä¿è·ã倱æããã
ãããã®ã»ãã¥ãªãã£äžã®èœãšã穎ãããããããã®æ©èœã¯ãŠã§ããã©ãããã©ãŒã ããåé€ãããããã»ã¹ã«ãããïŒããã¯äœå¹Žããããé·ãããã»ã¹ã§ãããïŒ
代ããã«ãå®å
šãªæ¹æ³ã§çæå
éã§éä¿¡ããããã«ãpostMessage()ãŸãã¯MessageChannelãªããžã§ã¯ãã䜿çšããã
The domain getter steps are:
Let effectiveDomain be this's origin's effective domain.
If effectiveDomain is null, then return the empty string.
Return effectiveDomain, serialized.
The domain setter steps are:
If this's browsing context is null, then throw a "SecurityError" DOMException.
If this's active sandboxing flag set has its sandboxed document.domain browsing context flag set, then throw a "SecurityError" DOMException.
Let effectiveDomain be this's origin's effective domain.
If effectiveDomain is null, then throw a "SecurityError" DOMException.
If the given value is not a registrable domain suffix of and is not equal to effectiveDomain, then throw a "SecurityError" DOMException.
If the surrounding agent's agent cluster's is origin-keyed is true, then return.
Set this's origin's domain to the result of parsing the given value.
To determine if a scalar value string hostSuffixString is a registrable domain suffix of or is equal to a host originalHost:
If hostSuffixString is the empty string, then return false.
Let hostSuffix be the result of parsing hostSuffixString.
If hostSuffix is failure, then return false.
If hostSuffix does not equal originalHost:
If hostSuffix or originalHost is not a domain, then return false.
This excludes hosts that are IP addresses.
If hostSuffix, prefixed by U+002E (.), does not match the end of originalHost, then return false.
If any of the following are true:
hostSuffix equals hostSuffix's public suffix; or
hostSuffix, prefixed by U+002E (.), matches the end of originalHost's public suffix,
then return false. [URL]
Assert: originalHost's public suffix, prefixed by U+002E (.), matches the end of hostSuffix.
Return true.
| hostSuffixString | originalHost | Outcome of is a registrable domain suffix of or is equal to | 泚 |
|---|---|---|---|
"0.0.0.0" | 0.0.0.0 | â | |
"0x10203" | 0.1.2.3 | â | |
"[0::1]" | ::1 | â | |
"example.com" | example.com | â | |
"example.com" | example.com. | â | Trailing dot is significant. |
"example.com." | example.com | â | |
"example.com" | www.example.com | â | |
"com" | example.com | â | At the time of writing, com is a public suffix. |
"example" | example | â | |
"compute.amazonaws.com" | example.compute.amazonaws.com | â | At the time of writing, *.compute.amazonaws.com is a public suffix. |
"example.compute.amazonaws.com" | www.example.compute.amazonaws.com | â | |
"amazonaws.com" | www.example.compute.amazonaws.com | â | |
"amazonaws.com" | test.amazonaws.com | â | At the time of writing, amazonaws.com is a registrable domain. |
Origin interfaceThe Origin interface represents an origin, allowing robust same origin and same site comparisons.
[Exposed=*]
interface Origin {
constructor ();
static Origin from (any value );
readonly attribute boolean opaque ;
boolean isSameOrigin (Origin other );
boolean isSameSite (Origin other );
};
Origin objects have an associated origin, which holds an origin.
Platform objects have an extract an origin operation, which returns null unless otherwise specified.
Objects implementing the Origin interface's extract an origin steps are to return this's origin.
The new Origin() constructor steps are to set this's origin to a unique opaque origin.
The static from(value) method steps are:
If value is a platform object:
Let origin be the result of executing value's extract an origin operation.
If origin is not null, then return a new Origin object whose origin is origin.
If value is a string:
Let parsedURL be the result of basic URL parsing value.
If parsedURL is not failure, then return a new Origin object whose origin is set to parsedURL's origin.
Throw a TypeError.
The opaque getter steps are to return true if this's origin is an opaque origin; otherwise false.
The isSameOrigin(other) method steps are to return true if this's origin is same origin with other's origin; otherwise false.
The isSameSite(other) method steps are to return true if this's origin is same site with other's origin; otherwise false.
window.originAgentClusterãã®ã»ã¯ã·ã§ã³ã§èª¬æãããŠããæ¹æ³ã§ããã®Windowãçæå
ããŒã®ãšãŒãžã§ã³ãã¯ã©ã¹ã¿ãŒã«å±ãå Žåã¯trueãè¿ãã
ã»ãã¥ã¢ãªã³ã³ããã¹ãã§é
ä¿¡ãããDocumentã¯ã`Origin-Agent-Cluster` HTTPã¬ã¹ãã³ã¹ããããŒã䜿çšããŠãçæå
ããŒã®ãšãŒãžã§ã³ãã¯ã©ã¹ã¿ãŒã«é
眮ããããã«èŠæ±ããããšãã§ããããã®ããããŒã¯æ§é åãããããããŒã§ããããã®å€ã¯çåœå€ã§ãªããã°ããªãã[STRUCTURED-FIELDS]
æ°ããDocumentãªããžã§ã¯ãã®äœæãšåæåã®åŠçã¢ãã«ã«ãã£ãŠãæ§é åãããããããŒã®çåœå€ã§ã¯ãªãå€ïŒããªãã¡ã`?1`ïŒã¯ç¡èŠãããã
ãã®ããããŒã䜿çšãããšãçµæãšããŠåŸãããDocumentã®ãšãŒãžã§ã³ãã¯ã©ã¹ã¿ããŒã¯ã察å¿ãããµã€ãã§ã¯ãªãããã®çæå
ãšãªããç®ã«èŠãã广ãšããŠãããã¯document.domainã䜿çšããŠåäžçæå
ã®å¶éãç·©åããããšããŠãäœãå®è¡ãããªã代ããã«ãWebAssembly.Moduleãªããžã§ã¯ããçæå
ããŸããã Documentã«éä¿¡ããããšãã§ããªããªãããšã§ããïŒããšãåããµã€ãã§ãã£ãŠãïŒãæ°Žé¢äžã§ããã®åé¢ã«ããããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãããã»ã¹ãã¹ã¬ãããªã©ã®ãšãŒãžã§ã³ãã¯ã©ã¹ã¿ãŒã«å¯Ÿå¿ããå®è£
åºæã®ãªãœãŒã¹ãããå¹ççã«å²ãåœãŠãããšãå¯èœã«ãªãã
ãã©ãŠãžã³ã°ã³ã³ããã¹ãã°ã«ãŒãå
ã§ã¯ã`Origin-Agent-Cluster`ããããŒã¯ãããšãäžæ¹ãããããŒãéä¿¡ãã仿¹ãéä¿¡ããªãå Žåã§ããåäžçæå
ã®Documentãªããžã§ã¯ããç°ãªããšãŒãžã§ã³ãã¯ã©ã¹ã¿ãŒã§çµããåå ã«ã¯ãªããªãããšã«æ³šæãããããã¯ãå±¥æŽãšãŒãžã§ã³ãã¯ã©ã¹ã¿ããŒãããã«ãã£ãŠé²æ¢ãããã
ã€ãŸããoriginAgentClusterã²ãã¿ãŒã¯ãåããã©ãŠãžã³ã°ã³ã³ããã¹ãã°ã«ãŒãå
ã®ä»¥åã«ããŒããããåäžçæå
ã®ããŒãžã§ããããŒãçç¥ãããŠããå ŽåãããšãããããŒãèšå®ãããŠããŠããfalseãè¿ãããšãã§ãããšããããšã§ãããåæ§ã«ãããããŒãèšå®ãããŠããªããŠãtrueãè¿ãããšãã§ããã
The originAgentCluster getter steps are to return the surrounding agent's agent cluster's is origin-keyed.
äžéæãªçæå
ããã€Documentã¯ãç¡æ¡ä»¶ã«çæå
ãåé¢ãããŠãããšã¿ãªãããšãã§ããããã®å ŽåãããããŒã¯å¹æããªãããã€originAgentClusterã²ãã¿ãŒã¯åžžã«trueãè¿ãã ããã
åæ§ã«ããšãŒãžã§ã³ãã¯ã©ã¹ã¿ãŒã®çæå
ããŸããã åé¢ã¢ãŒãã"none"ã§ã¯ãªãDocumentã¯ãèªåçã«çæå
ããŒãèšå®ããããçæå
ããŸããã åé¢ãéæããããã«äœ¿çšããã`Cross-Origin-Opener-Policy`ããã³ `Cross-Origin-Embedder-Policy`ããããŒã¯ãåãã¢ãã¬ã¹ç©ºéå
ã®ãã¹ãŠã®ãã®ãããã«ååšããããšãä¿èšŒããããšãç®çãšããŠããããã`Origin-Agent-Cluster`ããããŒã¯ããªãœãŒã¹ã®å²ãåœãŠã«é¢ããå®è£
ãžã®è¿œå ã®ãã³ããšããŠæçšã§ãããããããªããããããããã远å ããŠããèè
ã®ã³ãŒãã«è¿œå ã®ç®ã«èŠãã圱é¿ã¯ãªãã
ãªãŒãããŒããªã·ãŒå€ã¯ããããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ãã«ããã²ãŒããããããã¥ã¡ã³ãã«å¯Ÿããæ°ãããããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ãããã³ãããã«å¯Ÿå¿ããã°ã«ãŒãã®äœæã匷å¶ã§ãããå¯èœãªå€ã¯æ¬¡ã®ãšããïŒ
unsafe-none"ããã¯ïŒçŸåšã®ïŒããã©ã«ãã§ãããææžãå¥ã®ãªãŒãããŒããªã·ãŒãæå®ããªãéããææžããã®åã®ææžãšåããããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ããå æããããšãæå³ããã
same-origin-allow-popups"ããã¯ãåã®ææžãåããªãŒãããŒããªã·ãŒãæå®ããŠãããããããåäžçæå ã§ãªãéããææžã®æ°ãããããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ãã匷å¶çã«äœæããã
same-origin"ããã¯ã"same-origin-allow-popups"ãšåãããã«åäœããããäœæãããè£å©ãã©ãŠãžã³ã°ã³ã³ããã¹ãã¯ãåããªãŒãããŒããªã·ãŒãæã€åäžçæå
ã®ææžãå«ããå¿
èŠãããããšã远å ãããããããªããã°ããªãŒãããŒã«éå
¬éã§è¡šç€ºãããã
same-origin-plus-COEP"ããã¯"same-origin"ãšåãããã«åäœããããïŒæ°ããïŒãããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ãã®ã°ã«ãŒãã®çæå
ããŸããã åé¢ã"logical"ãŸãã¯"concrete"ã®ããããã«èšå®ããããšã远å ãããã
"same-origin-plus-COEP"ã¯`Cross-Origin-Opener-Policy`ããããŒã§çŽæ¥èšå®ããããšã¯ã§ããªããã`Cross-Origin-Opener-Policy: same-origin`ãš`Cross-Origin-Embedder-Policy` ããããŒïŒå€ã¯çæå
ããŸããã åé¢ãšäºæïŒãäžç·ã«èšå®ããçµæã§ããã
noopener-allow-popups"ããã¯ãå è¡ææžã«é¢ä¿ãªããææžã®æ°ãããããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ãã匷å¶çã«äœæããã
noopener-allow-popupså€ãå«ãããšããããé©çšãããææžãšãã®ãªãŒãããŒãšã®éã®ãªãŒãããŒé¢ä¿ãåæããããããããã®åäžçæå
ã®ææžã®éã«åŒ·åºãªã»ãã¥ãªãã£å¢çãäœæããªãã
åäžçæå ã®ã¢ããªã±ãŒã·ã§ã³ã«ãããã®ä»ã®ãªã¹ã¯ã«ã¯ã次ãããïŒ
ææžã®ã³ã³ãã³ãããã§ããããåäžçæå ãªã¯ãšã¹ã â Fetch Metadataãã£ã«ã¿ãªã³ã°ã«ãã£ãŠç·©åã§ããã[FETCHMETADATA]
åäžçæå
ãã¬ãŒãã³ã° - X-Frame-OptionsãŸãã¯CSP frame-ancestorsã«ãã£ãŠç·©åã§ããã
JavaScriptã§ã¢ã¯ã»ã¹å¯èœãªcookie - ãã¹ãŠã®cookieãhttponlyã§ããããšã確èªããããšã§ç·©åã§ããã
æ©å¯ããŒã¿ãžã®localStorageã¢ã¯ã»ã¹ã
ãµãŒãã¹ã¯ãŒã«ãŒã®ã€ã³ã¹ããŒã«ã
Cache APIã®æäœãŸãã¯æ©å¯ããŒã¿ãžã®ã¢ã¯ã»ã¹ã[SW]
æ©å¯æ
å ±ãå
¬éããpostMessageãŸãã¯BroadcastChannelã¡ãã»ãŒãžã³ã°ã
åäžçæå ã®ææžã«å¯ŸããŠãŠãŒã¶ãŒã®æäœãå¿ èŠãšããªãèªåå ¥åã
noopener-allow-popupsã䜿çšããéçºè
ã¯ãæ©å¯æ§ã®é«ãã¢ããªã±ãŒã·ã§ã³ããlocalStorageããã®ä»ã®ã¯ã©ã€ã¢ã³ããµã€ãã®ã¹ãã¬ãŒãžAPIã BroadcastChannelãé¢é£ããåäžçæå
ã®éä¿¡ã¡ã«ããºã ãªã©ãä»ã®åäžçæå
ã®ææžã«ã¢ã¯ã»ã¹ã§ããã¯ã©ã€ã¢ã³ããµã€ãã®æ©èœã«äŸåããªãããã«ããå¿
èŠãããããŸãããµãŒããŒãµã€ãã®ãšã³ããã€ã³ãããå¿çã³ã³ãã³ããåäžå»çæå
ã®ããã¥ã¡ã³ãã«éããã²ãŒã·ã§ã³ã®ãªã¯ãšã¹ãã«æ©å¯ããŒã¿ãæ»ããªãããã«ããå¿
èŠãããã
An opener policy consists of:
A value, which is an opener policy value, initially "unsafe-none".
ã¬ããŒãã£ã³ã°ãšã³ããã€ã³ããããã¯æååãŸãã¯nullã§ãããæåã¯nullã§ããã
A report-only value, which is an opener policy value, initially "unsafe-none".
ã¬ããŒãã®ã¿ã®ã¬ããŒãã£ã³ã°ãšã³ããã€ã³ããããã¯æååãŸãã¯nullã§ãããæåã¯nullã§ããã
To match opener policy values, given an opener policy value documentCOOP, an origin documentOrigin, an opener policy value responseCOOP, and an origin responseOrigin:
If documentCOOP is "unsafe-none" and responseCOOP is "unsafe-none", then return true.
If documentCOOP is "unsafe-none" or responseCOOP is "unsafe-none", then return false.
If documentCOOP is responseCOOP and documentOrigin is same origin with responseOrigin, then return true.
falseãè¿ãã
Headers/Cross-Origin-Opener-Policy
Support in all current engines.
Documentã®çæå
ããŸããã ãªãŒãããŒããªã·ãŒã¯ `Cross-Origin-Opener-Policy`ããã³`Cross-Origin-Opener-Policy-Report-Only` HTTPã¬ã¹ãã³ã¹ããããŒããæŽŸçããããã®ããããŒã¯æ§é åãããããããŒã§ããããã®å€ã¯ããŒã¯ã³ã§ãªããã°ãªããªãã[STRUCTURED-FIELDS]
劥åœãªããŒã¯ã³ã®å€ã¯ããªãŒãããŒããªã·ãŒå€ã§ãããããŒã¯ã³ã¯ãŸããä»å±ã®ãã©ã¡ãŒã¿ãŒãæã£ãŠãããããããã®ãã¡ã"report-to"ãã©ã¡ãŒã¿ãŒã¯ãé©åãªå ±åãšã³ããã€ã³ããèå¥ãã劥åœãªURLæååãæã€ããšãã§ããã[REPORTING]
以äžã«èª¬æããåŠçã¢ãã«ã«åŸã£ãŠããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ããã®ããããŒã«äžæ£å€ãå«ãŸããŠããå Žåããã®ããããŒãç¡èŠãããåæ§ã«ãå€ãããŒã¯ã³ãšããŠè§£æã§ããªãå ŽåããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãã®ããããŒãç¡èŠããã
To obtain an opener policy given a response response and an environment reservedEnvironment:
Let policy be a new opener policy.
If reservedEnvironment is a non-secure context, then return policy.
Let parsedItem be the result of getting a structured field value given `Cross-Origin-Opener-Policy` and "item" from response's header list.
If parsedItem is not null:
If parsedItem[0] is "same-origin":
Let coep be the result of obtaining a cross-origin embedder policy from response and reservedEnvironment.
If coep's value is compatible with cross-origin isolation, then set policy's value to "same-origin-plus-COEP".
Otherwise, set policy's value to "same-origin".
If parsedItem[0] is "same-origin-allow-popups", then set policy's value to "same-origin-allow-popups".
If parsedItem[0] is "noopener-allow-popups", then set policy's value to "noopener-allow-popups".
If parsedItem[1]["report-to"] exists and it is a string, then set policy's reporting endpoint to parsedItem[1]["report-to"].
Set parsedItem to the result of getting a structured field value given `Cross-Origin-Opener-Policy-Report-Only` and "item" from response's header list.
If parsedItem is not null:
If parsedItem[0] is "same-origin":
Let coep be the result of obtaining a cross-origin embedder policy from response and reservedEnvironment.
If coep's value is compatible with cross-origin isolation or coep's report-only value is compatible with cross-origin isolation, then set policy's report-only value to "same-origin-plus-COEP".
Report only COOP also considers report-only COEP to assign the special "same-origin-plus-COEP" value. This allows developers more freedom in the order of deployment of COOP and COEP.
Otherwise, set policy's report-only value to "same-origin".
If parsedItem[0] is "same-origin-allow-popups", then set policy's report-only value to "same-origin-allow-popups".
If parsedItem[1]["report-to"] exists and it is a string, then set policy's report-only reporting endpoint to parsedItem[1]["report-to"].
Return policy.
To check if popup COOP values require a browsing context group switch, given two origins responseOrigin and activeDocumentNavigationOrigin, and two opener policy values responseCOOPValue and activeDocumentCOOPValue:
If responseCOOPValue is "noopener-allow-popups", then return true.
If all of the following are true:
activeDocumentCOOPValue's value is "same-origin-allow-popups" or "noopener-allow-popups"; and
responseCOOPValue is "unsafe-none",
then return false.
If the result of matching activeDocumentCOOPValue, activeDocumentNavigationOrigin, responseCOOPValue, and responseOrigin is true, then return false.
Return true.
To check if COOP values require a browsing context group switch, given a boolean isInitialAboutBlank, two origins responseOrigin and activeDocumentNavigationOrigin, and two opener policy values responseCOOPValue and activeDocumentCOOPValue:
If isInitialAboutBlank is true, then return the result of checking if popup COOP values requires a browsing context group switch with responseOrigin, activeDocumentNavigationOrigin, responseCOOPValue, and activeDocumentCOOPValue.
Here we are dealing with a non-popup navigation.
If the result of matching activeDocumentCOOPValue, activeDocumentNavigationOrigin, responseCOOPValue, and responseOrigin is true, then return false.
Return true.
To check if enforcing report-only COOP would require a browsing context group switch, given a boolean isInitialAboutBlank, two origins responseOrigin, activeDocumentNavigationOrigin, and two opener policies responseCOOP and activeDocumentCOOP:
If the result of checking if COOP values require a browsing context group switch given isInitialAboutBlank, responseOrigin, activeDocumentNavigationOrigin, responseCOOP's report-only value, and activeDocumentCOOPReportOnly's report-only value is false, then return false.
Matching report-only policies allows a website to specify the same report-only opener policy on all its pages and not receive violation reports for navigations between these pages.
If the result of checking if COOP values require a browsing context group switch given isInitialAboutBlank, responseOrigin, activeDocumentNavigationOrigin, responseCOOP's value, and activeDocumentCOOPReportOnly's report-only value is true, then return true.
If the result of checking if COOP values require a browsing context group switch given isInitialAboutBlank, responseOrigin, activeDocumentNavigationOrigin, responseCOOP's report-only value, and activeDocumentCOOPReportOnly's value is true, then return true.
falseãè¿ãã
An opener policy enforcement result is a struct with the following items:
A boolean needs a browsing context group switch, initially false.
A boolean would need a browsing context group switch due to report-only, initially false.
A URL url.
An origin origin.
An opener policy opener policy.
A boolean current context is navigation source, initially false.
To enforce a response's opener policy, given a browsing context browsingContext, a URL responseURL, an origin responseOrigin, an opener policy responseCOOP, an opener policy enforcement result currentCOOPEnforcementResult, and a referrer referrer:
Let newCOOPEnforcementResult be a new opener policy enforcement result with
Let isInitialAboutBlank be browsingContext's active document's is initial about:blank.
If isInitialAboutBlank is true and browsingContext's initial URL is null, set browsingContext's initial URL to responseURL.
If the result of checking if COOP values require a browsing context group switch given isInitialAboutBlank, currentCOOPEnforcementResult's opener policy's value, currentCOOPEnforcementResult's origin, responseCOOP's value, and responseOrigin is true:
Set newCOOPEnforcementResult's needs a browsing context group switch to true.
If browsingContext's group's browsing context set's size is greater than 1:
Queue a violation report for browsing context group switch when navigating to a COOP response with responseCOOP, "enforce", responseURL, currentCOOPEnforcementResult's url, currentCOOPEnforcementResult's origin, responseOrigin, and referrer.
Queue a violation report for browsing context group switch when navigating away from a COOP response with currentCOOPEnforcementResult's opener policy, "enforce", currentCOOPEnforcementResult's url, responseURL, currentCOOPEnforcementResult's origin, responseOrigin, and currentCOOPEnforcementResult's current context is navigation source.
If the result of checking if enforcing report-only COOP would require a browsing context group switch given isInitialAboutBlank, responseOrigin, currentCOOPEnforcementResult's origin, responseCOOP, and currentCOOPEnforcementResult's opener policy, is true:
Set newCOOPEnforcementResult's would need a browsing context group switch due to report-only to true.
If browsingContext's group's browsing context set's size is greater than 1:
Queue a violation report for browsing context group switch when navigating to a COOP response with responseCOOP, "reporting", responseURL, currentCOOPEnforcementResult's url, currentCOOPEnforcementResult's origin, responseOrigin, and referrer.
Queue a violation report for browsing context group switch when navigating away from a COOP response with currentCOOPEnforcementResult's opener policy, "reporting", currentCOOPEnforcementResult's url, responseURL, currentCOOPEnforcementResult's origin, responseOrigin, and currentCOOPEnforcementResult's current context is navigation source.
Return newCOOPEnforcementResult.
To obtain a browsing context to use for a navigation response, given navigation params navigationParams:
Let browsingContext be navigationParams's navigable's active browsing context.
If browsingContext is not a top-level browsing context, then return browsingContext.
Let coopEnforcementResult be navigationParams's COOP enforcement result.
Let swapGroup be coopEnforcementResult's needs a browsing context group switch.
Let sourceOrigin be browsingContext's active document's origin.
Let destinationOrigin be navigationParams's origin.
If sourceOrigin is not same site with destinationOrigin:
If either of sourceOrigin or destinationOrigin have a scheme that is not an HTTP(S) scheme and the user agent considers it necessary for sourceOrigin and destinationOrigin to be isolated from each other (for implementation-defined reasons), optionally set swapGroup to true.
For example, if a user navigates from about:settings to https://example.com, the user agent could force a swap.
Issue #10842 tracks settling on an interoperable behavior here, instead of letting this be optional.
If navigationParams's user involvement is "browser UI", optionally set swapGroup to true.
Issue #6356 tracks settling on an interoperable behavior here, instead of letting this be optional.
If browsingContext's group's browsing context set's size is 1, optionally set swapGroup to true.
Some implementations swap browsing context groups here for performance reasons.
The check for other contexts that could script this one is not sufficient to prevent differences in behavior that could affect a web page. Even if there are currently no other contexts, the destination page could open a window, then if the user navigates back, the previous page could expect to be able to script the opened window. Doing a swap here would break that use case.
If swapGroup is false:
If coopEnforcementResult's would need a browsing context group switch due to report-only is true, set browsingContext's virtual browsing context group ID to a new unique identifier.
Return browsingContext.
Let newBrowsingContext be the first return value of creating a new top-level browsing context and document.
In this case we are going to perform a browsing context group swap. browsingContext will not be used by the new Document that we are about to create. If it is not used by other Documents either (such as ones in the back/forward cache), then the user agent might destroy it at this point.
Let navigationCOOP be navigationParams's cross-origin opener policy.
If navigationCOOP's value is "same-origin-plus-COEP", then set newBrowsingContext's group's cross-origin isolation mode to either "logical" or "concrete". The choice of which is implementation-defined.
It is difficult on some platforms to provide the security properties required by the cross-origin isolated capability. "concrete" grants access to it and "logical" does not.
Let sandboxFlags be a clone of navigationParams's final sandboxing flag set.
If sandboxFlags is not empty:
Assert: navigationCOOP's value is "unsafe-none".
Assert: newBrowsingContext's popup sandboxing flag set is empty.
Set newBrowsingContext's popup sandboxing flag set to sandboxFlags.
Return newBrowsingContext.
An accessor-accessed relationship is an enum that describes the relationship between two browsing contexts between which an access happened. It can take the following values:
The accessor browsing context or one of its ancestors is the opener browsing context of the accessed browsing context's top-level browsing context.
The accessed browsing context or one of its ancestors is the opener browsing context of the accessor browsing context's top-level browsing context.
There is no opener relationship between the accessor browsing context, the accessor browsing context, or any of their ancestors.
To check if an access between two browsing contexts should be reported, given two browsing contexts accessor and accessed, a JavaScript property name P, and an environment settings object environment:
If P is not a cross-origin accessible window property name, then return.
Assert: accessor's active document and accessed's active document are both fully active.
Let accessorTopDocument be accessor's top-level browsing context's active document.
Let accessorInclusiveAncestorOrigins be the list obtained by taking the origin of the active document of each of accessor's active document's inclusive ancestor navigables.
Let accessedTopDocument be accessed's top-level browsing context's active document.
Let accessedInclusiveAncestorOrigins be the list obtained by taking the origin of the active document of each of accessed's active document's inclusive ancestor navigables.
If any of accessorInclusiveAncestorOrigins are not same origin with accessorTopDocument's origin, or if any of accessedInclusiveAncestorOrigins are not same origin with accessedTopDocument's origin, then return.
This avoids leaking information about cross-origin iframes to a top level frame with opener policy reporting.
If accessor's top-level browsing context's virtual browsing context group ID is accessed's top-level browsing context's virtual browsing context group ID, then return.
Let accessorAccessedRelationship be a new accessor-accessed relationship with value none.
If accessed's top-level browsing context's opener browsing context is accessor or is an ancestor of accessor, then set accessorAccessedRelationship to accessor is opener.
If accessor's top-level browsing context's opener browsing context is accessed or is an ancestor of accessed, then set accessorAccessedRelationship to accessor is openee.
Queue violation reports for accesses, given accessorAccessedRelationship, accessorTopDocument's opener policy, accessedTopDocument's opener policy, accessor's active document's URL, accessed's active document's URL, accessor's top-level browsing context's initial URL, accessed's top-level browsing context's initial URL, accessor's active document's origin, accessed's active document's origin, accessor's top-level browsing context's opener origin at creation, accessed's top-level browsing context's opener origin at creation, accessorTopDocument's referrer, accessedTopDocument's referrer, P, and environment.
To sanitize a URL to send in a report given a URL url:
Let sanitizedURL be a copy of url.
Set the username given sanitizedURL and the empty string.
Set the password given sanitizedURL and the empty string.
Return the serialization of sanitizedURL with exclude fragment set to true.
To queue a violation report for browsing context group switch when navigating to a COOP response given an opener policy coop, a string disposition, a URL coopURL, a URL previousResponseURL, two origins coopOrigin and previousResponseOrigin, and a referrer referrer:
If coop's reporting endpoint is null, return.
Let coopValue be coop's value.
If disposition is "reporting", then set coopValue to coop's report-only value.
Let serializedReferrer be an empty string.
If referrer is a URL, set serializedReferrer to the serialization of referrer.
Let body be a new object containing the following properties:
| key | value |
|---|---|
| disposition | disposition |
| effectivePolicy | coopValue |
| previousResponseURL | If coopOrigin and previousResponseOrigin are same origin this is the sanitization of previousResponseURL, null otherwise. |
| referrer | serializedReferrer |
| type | "navigation-to-response" |
Queue body as "coop" for coop's reporting endpoint with coopURL.
To queue a violation report for browsing context group switch when navigating away from a COOP response given an opener policy coop, a string disposition, a URL coopURL, a URL nextResponseURL, two origins coopOrigin and nextResponseOrigin, and a boolean isCOOPResponseNavigationSource:
If coop's reporting endpoint is null, return.
Let coopValue be coop's value.
If disposition is "reporting", then set coopValue to coop's report-only value.
Let body be a new object containing the following properties:
| key | value |
|---|---|
| disposition | disposition |
| effectivePolicy | coopValue |
| nextResponseURL | If coopOrigin and nextResponseOrigin are same origin or isCOOPResponseNavigationSource is true, this is the sanitization of nextResponseURL, null otherwise. |
| type | "navigation-from-response" |
Queue body as "coop" for coop's reporting endpoint with coopURL.
To queue violation reports for accesses, given an accessor-accessed relationship accessorAccessedRelationship, two opener policies accessorCOOP and accessedCOOP, four URLs accessorURL, accessedURL, accessorInitialURL, accessedInitialURL, four origins accessorOrigin, accessedOrigin, accessorCreatorOrigin and accessedCreatorOrigin, two referrers accessorReferrer and accessedReferrer, a string propertyName, and an environment settings object environment:
If coop's reporting endpoint is null, return.
Let coopValue be coop's value.
If disposition is "reporting", then set coopValue to coop's report-only value.
If accessorAccessedRelationship is accessor is opener:
Queue a violation report for access to an opened window, given accessorCOOP, accessorURL, accessedURL, accessedInitialURL, accessorOrigin, accessedOrigin, accessedCreatorOrigin, propertyName, and environment.
Queue a violation report for access from the opener, given accessedCOOP, accessedURL, accessorURL, accessedOrigin, accessorOrigin, propertyName, and accessedReferrer.
Otherwise, if accessorAccessedRelationship is accessor is openee:
Queue a violation report for access to the opener, given accessorCOOP, accessorURL, accessedURL, accessorOrigin, accessedOrigin, propertyName, accessorReferrer, and environment.
Queue a violation report for access from an opened window, given accessedCOOP, accessedURL, accessorURL, accessorInitialURL, accessedOrigin, accessorOrigin, accessorCreatorOrigin, and propertyName.
Otherwise:
Queue a violation report for access to another window, given accessorCOOP, accessorURL, accessedURL, accessorOrigin, accessedOrigin, propertyName, and environment.
Queue a violation report for access from another window, given accessedCOOP, accessedURL, accessorURL, accessedOrigin, accessorOrigin, and propertyName.
To queue a violation report for access to the opener, given an opener policy coop, two URLs coopURL and openerURL, two origins coopOrigin and openerOrigin, a string propertyName, a referrer referrer, and an environment settings object environment:
Let sourceFile, lineNumber, and columnNumber be the relevant script URL and problematic position which triggered this report.
Let serializedReferrer be an empty string.
If referrer is a URL, set serializedReferrer to the serialization of referrer.
Let body be a new object containing the following properties:
| key | value |
|---|---|
| disposition | "reporting" |
| effectivePolicy | coop's report-only value |
| property | propertyName |
| openerURL | If coopOrigin and openerOrigin are same origin, this is the sanitization of openerURL, null otherwise. |
| referrer | serializedReferrer |
| sourceFile | sourceFile |
| lineNumber | lineNumber |
| columnNumber | columnNumber |
| type | "access-to-opener" |
Queue body as "coop" for coop's reporting endpoint with coopURL and environment.
To queue a violation report for access to an opened window, given an opener policy coop, three URLs coopURL, openedWindowURL and initialWindowURL, three origins coopOrigin, openedWindowOrigin, and openerInitialOrigin, a string propertyName, and an environment settings object environment:
Let sourceFile, lineNumber, and columnNumber be the relevant script URL and problematic position which triggered this report.
Let body be a new object containing the following properties:
| key | value |
|---|---|
| disposition | "reporting" |
| effectivePolicy | coop's report-only value |
| property | propertyName |
| openedWindowURL | If coopOrigin and openedWindowOrigin are same origin, this is the sanitization of openedWindowURL, null otherwise. |
| openedWindowInitialURL | If coopOrigin and openerInitialOrigin are same origin, this is the sanitization of initialWindowURL, null otherwise. |
| sourceFile | sourceFile |
| lineNumber | lineNumber |
| columnNumber | columnNumber |
| type | "access-to-opener" |
Queue body as "coop" for coop's reporting endpoint with coopURL and environment.
To queue a violation report for access to another window, given an opener policy coop, two URLs coopURL and otherURL, two origins coopOrigin and otherOrigin, a string propertyName, and an environment settings object environment:
Let sourceFile, lineNumber, and columnNumber be the relevant script URL and problematic position which triggered this report.
Let body be a new object containing the following properties:
| key | value |
|---|---|
| disposition | "reporting" |
| effectivePolicy | coop's report-only value |
| property | propertyName |
| otherURL | If coopOrigin and otherOrigin are same origin, this is the sanitization of otherURL, null otherwise. |
| sourceFile | sourceFile |
| lineNumber | lineNumber |
| columnNumber | columnNumber |
| type | "access-to-opener" |
Queue body as "coop" for coop's reporting endpoint with coopURL and environment.
To queue a violation report for access from the opener, given an opener policy coop, two URLs coopURL and openerURL, two origins coopOrigin and openerOrigin, a string propertyName, and a referrer referrer:
If coop's reporting endpoint is null, return.
Let serializedReferrer be an empty string.
If referrer is a URL, set serializedReferrer to the serialization of referrer.
Let body be a new object containing the following properties:
| key | value |
|---|---|
| disposition | "reporting" |
| effectivePolicy | coop's report-only value |
| property | propertyName |
| openerURL | If coopOrigin and openerOrigin are same origin, this is the sanitization of openerURL, null otherwise. |
| referrer | serializedReferrer |
| type | "access-to-opener" |
Queue body as "coop" for coop's reporting endpoint with coopURL.
To queue a violation report for access from an opened window, given an opener policy coop, three URLs coopURL, openedWindowURL and initialWindowURL, three origins coopOrigin, openedWindowOrigin, and openerInitialOrigin, and a string propertyName:
If coop's reporting endpoint is null, return.
Let body be a new object containing the following properties:
| key | value |
|---|---|
| disposition | "reporting" |
| effectivePolicy | coopValue |
| property | coop's report-only value |
| openedWindowURL | If coopOrigin and openedWindowOrigin are same origin, this is the sanitization of openedWindowURL, null otherwise. |
| openedWindowInitialURL | If coopOrigin and openerInitialOrigin are same origin, this is the sanitization of initialWindowURL, null otherwise. |
| type | "access-to-opener" |
Queue body as "coop" for coop's reporting endpoint with coopURL.
To queue a violation report for access from another window, given an opener policy coop, two URLs coopURL and otherURL, two origins coopOrigin and otherOrigin, and a string propertyName:
If coop's reporting endpoint is null, return.
Let body be a new object containing the following properties:
| key | value |
|---|---|
| disposition | "reporting" |
| effectivePolicy | coop's report-only value |
| property | propertyName |
| otherURL | If coopOrigin and otherOrigin are same origin, this is the sanitization of otherURL, null otherwise. |
| type | access-to-opener |
Queue body as "coop" for coop's reporting endpoint with coopURL.
Headers/Cross-Origin-Embedder-Policy
Support in all current engines.
åã蟌ã¿ããªã·ãŒå€ã¯ããªãœãŒã¹ææè ããã®æç€ºçãªèš±å¯ãªãã«ãçæå ããŸããã ãªãœãŒã¹ã®ãã§ãããå¶åŸ¡ãã3ã€ã®æååã®1ã€ã§ããã
unsafe-none"ããã¯ããã©ã«ãã®å€ã§ããããã®å€ã䜿çšãããšããCORSãããã³ã«ãŸãã¯`Cross-Origin-Resource-Policy`ããããŒãéããŠæç€ºçãªèš±å¯ãäžããããšãªãã«çæå
ããŸããã ãªãœãŒã¹ããã§ããããããšãã§ããã
require-corp"ãã®å€ã䜿çšãããšããçæå
ããŸããã ãªãœãŒã¹ããã§ããããã«ã¯ãCORSãããã³ã«ãŸãã¯`Cross-Origin-Resource-Policy`ããããŒãéããŠãµãŒããŒã®æç€ºçãªèš±å¯ãå¿
èŠãšãªãã
credentialless"ãã®å€ã䜿çšããå Žåãçæå
ããŸããã no-CORSãªãœãŒã¹ããã§ãããããšãã¯ã¬ãã³ã·ã£ã«ãçç¥ãããã代ããã«ãæç€ºçãª`Cross-Origin-Resource-Policy`ããããŒã¯å¿
èŠãªããã¯ã¬ãã³ã·ã£ã«ã䜿çšããŠéä¿¡ããããã®ä»ã®ãªã¯ãšã¹ãã«ã¯ãCORSãããã³ã«ãŸã㯠`Cross-Origin-Resource-Policy`ããããŒãä»ãããµãŒããŒã®æç€ºçãªæš©éãå¿
èŠã§ããã
"credentialless"ããµããŒãããåã«ãå®è£
è
ã¯æ¬¡ã®äž¡æ¹ããµããŒãããããšã匷ãå§ããïŒ
ããã§ãªããã°ãæ»æè ã¯ãçæå ããŸããã å颿©èœã䜿çšããŠãã¯ã©ã€ã¢ã³ãã®ãããã¯ãŒã¯äœçœ®ãå©çšããŠéå ¬éãªãœãŒã¹ãèªã¿åãããšãå¯èœã«ããã
ãšã³ããããŒããªã·ãŒå€ã¯ã"credentialless"ãŸãã¯"require-corp"ã§ããå Žåãçæå
ããŸããã åé¢ãšäºææ§ãããã
åã蟌ã¿ããªã·ãŒã¯æ¬¡ã§æ§æãããïŒ
å€ãããã¯åã蟌ã¿ããªã·ãŒå€ã§ãããåæã¯"unsafe-none"ã
å ±åãšã³ããã€ã³ãæååãåæã¯ç©ºæååã
A report-only value, which is an embedder policy value, initially "unsafe-none".
A report-only reporting endpoint string, initially the empty string.
"coep"å ±åã¿ã€ãã¯ãå€ã"coep"ãšãªãå ±åã¿ã€ãã§ãããããã¯ReportingObserverããå¯èŠã§ããã
`Cross-Origin-Embedder-Policy`ããã³`Cross-Origin-Embedder-Policy-Report-Only` HTTPã¬ã¹ãã³ã¹ããããŒãã£ãŒã«ãã¯ããµãŒããŒãç°å¢èšå®ãªããžã§ã¯ãã®åã蟌ã¿ããªã·ãŒã宣èšããããšãå¯èœã«ããããã®ããããŒã¯æ§é åãããããããŒã§ããããã®å€ã¯ããŒã¯ã³ã§ãªããã°ãªããªãã[STRUCTURED-FIELDS]
劥åœãªããŒã¯ã³ã®å€ã¯ãåã蟌ã¿ããªã·ãŒå€ã§ãããããŒã¯ã³ã¯ãŸããä»å±ã®ãã©ã¡ãŒã¿ãŒãæã£ãŠãããããããã®ãã¡ã"report-to"ãã©ã¡ãŒã¿ãŒã¯ãé©åãªå ±åãšã³ããã€ã³ããèå¥ãã劥åœãªURLæååãæã€ããšãã§ããã[REPORTING]
åŠçã¢ãã«ã¯ãããŒã¯ã³ãšããŠè§£æã§ããªãããããŒã®ååšäžã§ã¯ãªãŒãã³ã«å€±æããïŒããã©ã«ãã§"unsafe-none"ïŒãããã«ã¯ãäžããããå¿çã«ååšãã`Cross-Origin-Embedder-Policy`ããããŒã®è€æ°ã®ã€ã³ã¹ã¿ã³ã¹ãçµã¿åãããŠäœæãããäžæ³šæãªãªã¹ããå«ãŸããã
`Cross-Origin-Embedder-Policy` | æçµåã蟌ã¿ããªã·ãŒå€ |
|---|---|
| No header delivered | "unsafe-none" |
`require-corp` | "require-corp" |
`unknown-value` | "unsafe-none" |
`require-corp, unknown-value` | "unsafe-none" |
`unknown-value, unknown-value` | "unsafe-none" |
`unknown-value, require-corp` | "unsafe-none" |
`require-corp, require-corp` | "unsafe-none" |
ïŒåãããšã`Cross-Origin-Embedder-Policy-Report-Only`ã«ãé©çšããããïŒ
To obtain an embedder policy from a response response and an environment environment:
Let policy be a new embedder policy.
If environment is a non-secure context, then return policy.
Let parsedItem be the result of getting a structured field value with `Cross-Origin-Embedder-Policy` and "item" from response's header list.
If parsedItem is non-null and parsedItem[0] is compatible with cross-origin isolation:
Set policy's value to parsedItem[0].
If parsedItem[1]["report-to"] exists, then set policy's reporting endpoint to parsedItem[1]["report-to"].
Set parsedItem to the result of getting a structured field value with `Cross-Origin-Embedder-Policy-Report-Only` and "item" from response's header list.
If parsedItem is non-null and parsedItem[0] is compatible with cross-origin isolation:
Set policy's report-only value to parsedItem[0].
If parsedItem[1]["report-to"] exists, then set policy's report-only reporting endpoint to parsedItem[1]["report-to"].
Return policy.
To check a navigation response's adherence to its embedder policy given a response response, a navigable navigable, and an embedder policy responsePolicy:
If navigable is not a child navigable, then return true.
Let parentPolicy be navigable's container document's policy container's embedder policy.
If parentPolicy's report-only value is compatible with cross-origin isolation and responsePolicy's value is not, then queue a cross-origin embedder policy inheritance violation with response, "navigation", parentPolicy's report-only reporting endpoint, "reporting", and navigable's container document's relevant settings object.
If parentPolicy's value is not compatible with cross-origin isolation or responsePolicy's value is compatible with cross-origin isolation, then return true.
Queue a cross-origin embedder policy inheritance violation with response, "navigation", parentPolicy's reporting endpoint, "enforce", and navigable's container document's relevant settings object.
falseãè¿ãã
To check a global object's embedder policy given a WorkerGlobalScope workerGlobalScope, an environment settings object owner, and a response response:
If workerGlobalScope is not a DedicatedWorkerGlobalScope object, then return true.
Let policy be workerGlobalScope's embedder policy.
Let ownerPolicy be owner's policy container's embedder policy.
If ownerPolicy's report-only value is compatible with cross-origin isolation and policy's value is not, then queue a cross-origin embedder policy inheritance violation with response, "worker initialization", ownerPolicy's report-only reporting endpoint, "reporting", and owner.
If ownerPolicy's value is not compatible with cross-origin isolation or policy's value is compatible with cross-origin isolation, then return true.
Queue a cross-origin embedder policy inheritance violation with response, "worker initialization", ownerPolicy's reporting endpoint, "enforce", and owner.
falseãè¿ãã
To queue a cross-origin embedder policy inheritance violation given a response response, a string type, a string endpoint, a string disposition, and an environment settings object settings:
Let serialized be the result of serializing a response URL for reporting with response.
Let body be a new object containing the following properties:
| key | value |
|---|---|
| type | type |
| blockedURL | serialized |
| disposition | disposition |
Queue body as the "coep" report type for endpoint on settings.
ãµã³ãããã¯ã¹ãã©ã°ã»ããã¯æ¬¡ã®ãã©ã°ã®0å以äžã®éåã§ãããããã¯æœåšçã«ä¿¡é ŒãããªããªãœãŒã¹ãæã€èœåãå¶éããããã«äœ¿çšãããïŒ
ãã®ãã©ã°ã¯ãã³ã³ãã³ããããµã³ãããã¯ã¹åããããã©ãŠãžã³ã°ã³ã³ããã¹ãèªäœïŒãŸãã¯ãã®äžã«ããã«ãã¹ãããããã©ãŠãžã³ã°ã³ã³ããã¹ãïŒãè£å©ãã©ãŠãžã³ã°ã³ã³ããã¹ãïŒæ¬¡ã«å®çŸ©ããããµã³ãããã¯ã¹åãããè£å©ããã²ãŒã·ã§ã³ãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°ã«ãã£ãŠä¿è·ãããŠããïŒãããã³ãããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ãïŒãµã³ãããã¯ã¹åããããŠãŒã¶ãŒèµ·åãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°ãªãã®ãããã¬ãã«ããã²ãŒã·ã§ã³ãããã³ä»¥äžã«å®çŸ©ããããµã³ãããã¯ã¹åããããŠãŒã¶ãŒèµ·åãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°ãããããã¬ãã«ããã²ãŒã·ã§ã³ã«ãã£ãŠä¿è·ãããŠããïŒä»¥å€ã®ãã©ãŠãžã³ã°ã³ã³ããã¹ããããã²ãŒãããããšã鲿¢ãããã®ã§ããã
ãµã³ãããã¯ã¹åãããè£å©ããã²ãŒã·ã§ã³ãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°ãèšå®ãããªãå Žåãããã«ããããããäžå®ã®å Žåã«ãããå¶éã¯ãããã¢ããïŒæ°ãããããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ãïŒãéãããšãã§ããããããã®ãã©ãŠãžã³ã°ã³ã³ããã¹ãã¯åžžã«ã1ã€ã®èš±å¯ããããµã³ãããã¯ã¹åãããããã²ãŒã¿ãŒãæã¡ãå®éã«ç§»åããããã«äœæãããã©ãŠãžã³ã°ã³ã³ããã¹ããèš±å¯ããããã©ãŠãžã³ã°ã³ã³ããã¹ããäœæããããšãã«èšå®ãæã€ãïŒããã§ãªããã°ããµã³ãããã¯ã¹åãããããã²ãŒã·ã§ã³ãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°ã¯ãããããéãããå Žåã§ãã£ãŠãããã²ãŒããããŠããã®ãé²ãã ãããïŒ
ãã®ãã©ã°ã¯ãã³ã³ãã³ããæ°ããè£å©ãã©ãŠãžã³ã°ã³ã³ããã¹ããäœæããã®ãé²ãã ããšãã°ãtarget屿§ãwindow.open()ã¡ãœããã䜿çšããã
ãã®ãã©ã°ã¯ããããã®ãããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ãã®ããã²ãŒãããã³ã³ãã³ããé²ãããã€ãããã®ãããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ãã®é®æããã³ã³ãã³ããé²ãããµã³ãããã¯ã¹åããããã©ãŠãžã³ã°ã³ã³ããã¹ãã®ã¢ã¯ãã£ããŠã£ã³ããŠãäžæçãªã¢ã¯ãã£ãåãæããªãå Žåã«ã®ã¿èæ ®ãããã
ãŠãŒã¶ãŒã«ããã¢ã¯ãã£ãåãªãã§ãµã³ãããã¯ã¹åããããããã¬ãã«ããã²ãŒã·ã§ã³ãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°ãèšå®ãããŠããªãå Žåãã³ã³ãã³ãã¯ãã®ãããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ããããã²ãŒãããããšãã§ããããä»ã®ãã©ãŠãžã³ã°ã³ã³ããã¹ãã¯ããµã³ãããã¯ã¹åãããããã²ãŒã·ã§ã³ãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°ãããã³ãµã³ãããã¯ã¹åãããè£å©ããã²ãŒã·ã§ã³ãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°ã«ãã£ãŠä¿è·ããããŸãŸã§ããã
ãã®ãã©ã°ã¯ããããã®ãããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ãã®ããã²ãŒãããã³ã³ãã³ããé²ãããã€ãããã®ãããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ãã®é®æããã³ã³ãã³ããé²ãããµã³ãããã¯ã¹åããããã©ãŠãžã³ã°ã³ã³ããã¹ãã®ã¢ã¯ãã£ããŠã£ã³ããŠãäžæçãªã¢ã¯ãã£ãåãæã€å Žåã«ã®ã¿èæ ®ãããã
ãŠãŒã¶ãŒã«ããã¢ã¯ãã£ãåãªãã§ãµã³ãããã¯ã¹åããããã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°ãšåæ§ã«ããã®ãã©ã°ã¯ãããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ãã«ã®ã¿åœ±é¿ããã èšå®ãããŠããªãå Žåãä»ã®ãã©ãŠãžã³ã°ã³ã³ããã¹ããä»ã®ãã©ã°ã«ãã£ãŠä¿è·ãããŠããå¯èœæ§ãããã
ãã®ãã©ã°ã¯ãäžéæãªçæå ã«ã³ã³ãã³ãã匷å¶ããããããã£ãŠãåäžçæå ããä»ã®ã³ã³ãã³ãã«ã¢ã¯ã»ã¹ããããšã鲿¢ããã
ãã®ãã©ã°ã¯ãŸããdocument.cookie IDL屿§ããã®èªã¿åããŸãã¯æžã蟌ã¿ãããã¹ã¯ãªããã鲿¢ããlocalStorageãžã®ã¢ã¯ã»ã¹ããããã¯ããã
ãã®ãã©ã°ã¯ãã©ãŒã éä¿¡ããããã¯ããã
ãã®ãã©ã°ã¯Pointer Lock APIãç¡å¹ã«ããã[POINTERLOCK]
ãã®ãã©ã°ã¯ãã¹ã¯ãªããã®å®è¡ããããã¯ããã
ãã®ãã©ã°ã¯ãèªåãããªåçãèªåãã©ãŒã ã³ã³ãããŒã«ãã©ãŒã«ã¹ãªã©ã®ãèªåçã«åãæ¿ããæ©èœããããã¯ããã
document.domainãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°ãã®ãã©ã°ã¯ãã³ã³ãã³ããdocument.domainã»ãã¿ãŒã䜿çšããããšããé²ãã
ãã®ãã©ã°ã¯ãã³ã³ãã³ããäœæããè£å©ãã©ãŠãžã³ã°ã³ã³ããã¹ããã³ã³ãã³ãã®ã¢ã¯ãã£ããªãµã³ãããã¯ã¹ãã©ã°ã»ãããç¶æ¿ããã®ãä¿èšŒããããšã§ããã®ã³ã³ãã³ãããµã³ãããã¯ã¹ããšã¹ã±ãŒãããã®ãé²ãã
ãã®ãã©ã°ã¯ãã³ã³ãã³ããæ¬¡ã®æ©èœã®ããããã䜿çšããŠã¢ãŒãã«ãã€ã¢ãã°ãçæããã®ãé²ãïŒ
ãã®ãã©ã°ã¯ãç»é¢ã®åããããã¯ããæ©èœãç¡å¹ã«ããã[SCREENORIENTATION]
ãã®ãã©ã°ã¯Presentation APIãç¡å¹ã«ããã [PRESENTATION]
ãã®ãã©ã°ã¯ããã€ããŒãªã³ã¯ã®ããŠã³ããŒããŸãã¯ããŠã³ããŒããšããŠåŠçãããããã²ãŒã·ã§ã³ã®ããããä»ããŠãã³ã³ãã³ããããŠã³ããŒããéå§ãŸãã¯ã€ã³ã¹ã¿ã³ã¹åããã®ãé²ãã
ãã®ãã©ã°ã¯ãéãã§ããã¹ããŒã ãžã®ããã²ãŒã·ã§ã³ãå€éšãœãããŠã§ã¢ã«æž¡ãããã®ã劚ããã
When the user agent is to parse a sandboxing directive, given a string input and a sandboxing flag set output, it must run the following steps:
Split input on ASCII whitespace, to obtain tokens.
outputã空ã«ããã
outputã«æ¬¡ã®ãã©ã°ã远å ããïŒ
ãµã³ãããã¯ã¹åãããããã²ãŒã·ã§ã³ãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°
tokensãallow-popupsããŒã¯ãŒããå«ãå Žåãé€ããŠããµã³ãããã¯ã¹åãããè£å©ããã²ãŒã·ã§ã³ãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°
The sandboxed top-level navigation without user activation browsing context flag, unless tokens contains the allow-top-navigation keyword.
The sandboxed top-level navigation with user activation browsing context flag, unless tokens contains either the allow-top-navigation-by-user-activation keyword or the allow-top-navigation keyword.
This means that if the allow-top-navigation is present, the allow-top-navigation-by-user-activation keyword will have no effect. For this reason, specifying both is a document conformance error.
tokensãallow-same-originããŒã¯ãŒããå«ãå Žåãé€ããŠããµã³ãããã¯ã¹åãããçæå
ãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°
allow-same-originããŒã¯ãŒãã¯2ã€ã®äŸã察象ãšããã
1ã€ç®ã¯ãäŸç¶ãšããŠãµã³ãããã¯ã¹åãããã³ã³ãã³ãã®DOMãžã®ã¢ã¯ã»ã¹ãå¯èœããäžæ¹ã§ãã¹ã¯ãªãããç¡å¹ã«ããããã«ãµã³ãããã¯ã¹åãããã¹ãåããµã€ãããã³ã³ãã³ããèš±å¯ããããã«äœ¿çšã§ããã
2ã€ç®ã¯ããµãŒãããŒãã£ãµã€ãããã³ã³ãã³ããåã蟌ãããã«äœ¿çšã§ããããŒã¿ãªã©ãæ ŒçŽããããã«ããŒã¿ããŒã¹APIã䜿çšããŠããã®å ã®ãµã€ãã«æ»ãéä¿¡ããåã蟌ãŸããããŒãžã劚ããããšãªãããããã¢ãããªã©ãéããŠããããã®ãµã€ããé²ãããã«ãµã³ãããã¯ã¹åããã
tokensãallow-formsããŒã¯ãŒããå«ãå Žåãé€ããŠããµã³ãããã¯ã¹åããããã©ãŒã ãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°
tokensãallow-pointer-lockããŒã¯ãŒããå«ãå Žåãé€ããŠããµã³ãããã¯ã¹åããããã€ã³ã¿ãŒããã¯ãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°
tokensãallow-scriptsããŒã¯ãŒããå«ãå Žåãé€ããŠããµã³ãããã¯ã¹åãããã¹ã¯ãªãããã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°
tokensãïŒäžèšã§å®çŸ©ãããïŒallow-scriptsããŒã¯ãŒããå«ãå Žåãé€ããŠããµã³ãããã¯ã¹åãããèªåæ©èœãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°
ãã®ãã©ã°ã¯ãã¹ã¯ãªãããšåãããŒã¯ãŒãã§ç·©åãããããªããªããã¹ã¯ãªãããæå¹ã§ããå Žåã«ãããã®æ©èœã¯ãããã«ããäºçްãªããšã§å®è¡ã§ãã宣èšçãªæ©èœã䜿çšã§ããããã«ããããããããµã³ãããã¯ã¹åãããå Žåã«ãèè ããããæ©èœãå®è¡ããããã®ã¹ã¯ãªããã䜿çšãããã匷å¶ããããšãäžå¹žã§ããããã§ããã
ãµã³ãããã¯ã¹åãããdocument.domainãã©ãŠãžã³ã°ã³ã³ããã¹ããã©ã°ã
The sandbox propagates to auxiliary browsing contexts flag, unless tokens contains the allow-popups-to-escape-sandbox keyword.
The sandboxed modals flag, unless tokens contains the allow-modals keyword.
The sandboxed orientation lock browsing context flag, unless tokens contains the allow-orientation-lock keyword.
The sandboxed presentation browsing context flag, unless tokens contains the allow-presentation keyword.
The sandboxed downloads browsing context flag, unless tokens contains the allow-downloads keyword.
The sandboxed custom protocols navigation browsing context flag, unless tokens contains either the allow-top-navigation-to-custom-protocols keyword, the allow-popups keyword, or the allow-top-navigation keyword.
ãã¹ãŠã®ãããã¬ãã«ãã©ãŠãžã³ã°ã³ã³ããã¹ãã¯ããããã¢ãããµã³ãããã¯ã¹å ãã©ã°ã»ãããæã¡ãããã¯ãµã³ãããã¯ã¹åãã©ã°ã»ããã§ããããã©ãŠãžã³ã°ã³ã³ããã¹ããäœæãããå Žåããã®ãããã¢ãããµã³ãåãã©ã°ã»ããã¯ç©ºã§ãªããã°ãªããªããIt is populated by the rules for choosing a navigable and the obtain a browsing context to use for a navigation response algorithm.
ãã¹ãŠã®iframeèŠçŽ ã¯ãiframeãµã³ãããã¯ã¹åãã©ã°ã»ãããæã¡ãããã¯ãµã³ãããã¯ã¹åãã©ã°ã»ããã§ãããiframeãµã³ãããã¯ã¹åãã©ã°ã»ããã®ã©ã®ãã©ã°ãç¹å®ã®æéã«ã»ããããããã¯ãiframeèŠçŽ ã®sandbox 屿§ã«ãã£ãŠæ±ºå®ãããã
ãã¹ãŠã®Documentã¯ãã¢ã¯ãã£ããªãµã³ãããã¯ã¹åãã©ã°ã»ãããæã¡ãããã¯ãµã³ãããã¯ã¹åãã©ã°ã»ããã§ãããDocumentãäœæãããå Žåããã®ã¢ã¯ãã£ããªãµã³ãããã¯ã¹åãã©ã°ã»ããã¯ç©ºã§ãªããã°ãªããªããããã¯ãããã²ãŒã·ã§ã³ã¢ã«ãŽãªãºã ã«ãã£ãŠè¿œå ãããã
Every CSP list cspList has CSP-derived sandboxing flags, which is a sandboxing flag set. It is the return value of the following algorithm:
Let directives be an empty ordered set.
For each policy in cspList:
If policy's disposition is not "enforce", then continue.
If policy's directive set contains a directive whose name is "sandbox", then append that directive to directives.
If directives is empty, then return an empty sandboxing flag set.
Let directive be directives[directives's size â 1].
Return the result of parsing the sandboxing directive directive.
nullãŸãã¯èŠçŽ embedderãæå®ããŠããã©ãŠãžã³ã°ã³ã³ããã¹ãbrowsing contextã®äœæãµã³ãããã¯ã¹ãã©ã°ã決å®ããã«ã¯ã次ã®ãµã³ãããã¯ã¹ãã©ã°ã»ããã«ååšãããã©ã°ã®åéåãè¿ãã
If embedder is null, then the flags set on browsing context's popup sandboxing flag set.
If embedder is an element, then the flags set on embedder's iframe sandboxing flag set.
If embedder is an element, then the flags set on embedder's node document's active sandboxing flag set.
iframe element referrer policyTo determine the iframe element referrer policy given an element-or-null embedder:
If embedder is an iframe element, then return embedder's referrerpolicy attribute's state's corresponding keyword.
空æååãè¿ãã
This is used for allowing masking of some origins in the internal ancestor origin objects list creation steps.
A policy container is a struct containing policies that apply to a Document, a WorkerGlobalScope, or a WorkletGlobalScope. It has the following items:
A CSP list, which is a CSP list. It is initially empty.
An embedder policy, which is an embedder policy. It is initially a new embedder policy.
A referrer policy, which is a referrer policy. It is initially the default referrer policy.
An integrity policy, which is an integrity policy, initially a new integrity policy.
A report-only integrity policy, which is an integrity policy, initially a new integrity policy.
Move other policies into the policy container.
To clone a policy container given a policy container policyContainer:
Let clone be a new policy container.
For each policy in policyContainer's CSP list, append a copy of policy into clone's CSP list.
Set clone's embedder policy to a copy of policyContainer's embedder policy.
Set clone's referrer policy to policyContainer's referrer policy.
Set clone's integrity policy to a copy of policyContainer's integrity policy.
Return clone.
To determine whether a URL url requires storing the policy container in history:
To create a policy container from a fetch response given a response response and an environment-or-null environment:
If response's URL's scheme is "blob", then return a clone of response's URL's blob URL entry's environment's policy container.
Let result be a new policy container.
Set result's CSP list to the result of parsing a response's Content Security Policies given response.
If environment is non-null, then set result's embedder policy to the result of obtaining an embedder policy given response and environment. Otherwise, set it to "unsafe-none".
Set result's referrer policy to the result of parsing the `Referrer-Policy` header given response. [REFERRERPOLICY]
Parse Integrity-Policy headers with response and result.
Return result.
To determine navigation params policy container given a URL responseURL and four policy container-or-nulls historyPolicyContainer, initiatorPolicyContainer, parentPolicyContainer, and responsePolicyContainer:
If historyPolicyContainer is not null:
Assert: responseURL requires storing the policy container in history.
Return a clone of historyPolicyContainer.
If responseURL is about:srcdoc:
If responseURL is local and initiatorPolicyContainer is not null, then return a clone of initiatorPolicyContainer.
If responsePolicyContainer is not null, then return responsePolicyContainer.
Return a new policy container.
To initialize a worker global scope's policy container given a WorkerGlobalScope workerGlobalScope, a response response, and an environment environment:
If workerGlobalScope's url is local but its scheme is not "blob":
Set workerGlobalScope's policy container to a clone of workerGlobalScope's owner set[0]'s relevant settings object's policy container.
Otherwise, set workerGlobalScope's policy container to the result of creating a policy container from a fetch response given response and environment.