From a7e54359cadab65bdf5d32c6ff100d85585c9851 Mon Sep 17 00:00:00 2001
From: clamy The following feature is defined in Reporting API:
+
+
+ Cross-Origin-Embedder-Policy
` header
+
The Document
has a cross-origin opener
- policy, which is a cross-origin opener policy, initially "unsafe-none
".
DocumentOrShadowRoot
interfaceLet coop be a new cross-origin opener policy.
If creator is non-null and creator's origin is + same origin with creator's relevant settings object's + top-level origin, then set coop to creator's browsing context's top-level browsing context's + active document's cross-origin opener + policy.
Let document be a new Document
, marked as an HTML document in quirks mode, whose content type is "text/html
",
@@ -77511,10 +77531,10 @@ console.assert(iframeWindow.frameElement === null);
If current's top-level browsing context's active
- document's cross-origin opener policy is
- "same-origin
" or "same-origin-plus-COEP
", then:
If current's top-level browsing context's active
+ document's cross-origin opener policy's
+ value is "same-origin
" or
+ "same-origin-plus-COEP
", then:
Let currentDocument be current's active
@@ -79968,10 +79988,30 @@ interface BarProp {
A cross-origin opener policy allows a document which is navigated to in a
top-level browsing context to force the creation of a new top-level browsing
- context, and a corresponding group. It has one of the
- following values:Cross-origin opener policies
+ Cross-origin opener policy
+
A cross-origin opener policy value
+ (value), initially "unsafe-none
".
A string or null
(reporting
+ endpoint), initially null
.
A cross-origin opener policy value
+ (report only value), initially "unsafe-none
".
A string or null
(report only reporting endpoint), initially null
.
The cross-origin opener policy value consists of the following:
unsafe-none
"To match cross-origin opener policies, given a - cross-origin opener policy A, an origin originA, a - cross-origin opener policy B, and an origin - originB:
+To match cross-origin opener policy values, given a cross-origin opener policy value A, an + origin originA, a >cross-origin opener + policy value B, and an origin originB:
If A is "unsafe-none
" and B
@@ -80026,13 +80066,15 @@ interface BarProp {
Return false.
A Document
's cross-origin opener
policy is derived from the `Cross-Origin-Opener-Policy
` HTTP response header.
- This header is a structured header whose value must
- be a token.
Cross-Origin-Opener-Policy-Report-Only
`
+ HTTP response headers. These headers are structured
+ headers whose value must be a token.
+
The valid token values are "unsafe-none
", "BarProp {
data-x="concept-response">response response:
Let policy be a new cross-origin opener policy.
Let securityState be the result of executing Is url potentially trustworthy? on response's url.
If securityState is "Not Trustworthy
", then return
- "unsafe-none
".
Let value be the result of getting a structured header
@@ -80063,40 +80107,196 @@ interface BarProp {
"item
" from response's header list.
If value is failure or null, then return "unsafe-none
".
If value is not failure
and is not null
, then:
If value bare item is "same-origin
", then:
If value[0] is not "same-origin
" or
- "same-origin-allow-popups
", then return
- "unsafe-none
".
Let coep be the result of obtaining a cross-origin embedder + policy from response.
If value[0] is "same-origin
", then:
If coep's value is
+ "require-corp
", then set policy value to "same-origin-plus-COEP
".
Else, set policy value to "same-origin
".
If value bare item is "same-origin-allow-popups
",
+ then set policy value to "same-origin-allow-popups
".
If value's parameters["report-to"] exists and it is a string, then set reporting endpoint to + value's parameters["report-to"].
Let reportOnlyValue be the result of getting a structured header
+ given `Cross-Origin-Opener-Policy-Report-Only
` and
+ "item
" from response's header list.
If reportOnlyValue is not failure
and is not null
, then:
Let coep be the result of obtaining a cross-origin embedder - policy from response.
If reportOnlyValue bare item is "same-origin
", then:
Let coep be the result of obtaining a cross-origin embedder + policy from response.
If coep's value is
+ "require-corp
" or coep's report only value is "require-corp
", then set policy 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.
If coep is "require-corp
", then return "same-origin-plus-COEP
".
Else, set policy report only
+ value to "same-origin
".
If reportOnlyValue bare item is "same-origin-allow-popups
", then set policy report only value to "same-origin-allow-popups
".
If reportOnlyValue's parameters["report-to"] exists and it is a string, then set report only reporting endpoint to + reportOnlyValue's parameters["report-to"].
Return value[0].
Return policy.
To check if a cross-origin opener + policy value requires a browsing context group switch, given a boolean + isInitialEmptyDocument, two origins + responseOrigin, activeDocumentNavigationOrigin, and two cross-origin opener policy values responseCOOPValue, + activeDocumentCOOPValue:
+ +If the result of matching
+ activeDocumentCOOPValue, activeDocumentNavigationOrigin,
+ responseCOOPValue and responseOrigin is true, return
+ false
.
If all of the following are true:
+ +isInitialEmptyDocument.
activeDocumentCOOPValue's value is "same-origin-allow-popups
".
responseCOOPValue is "unsafe-none
".
then return false
.
Return true
.
To check if enforcing report only COOP + policies would require a browsing context group switch, given a boolean + isInitialEmptyDocument, two origins + responseOrigin, activeDocumentNavigationOrigin, and two cross-origin opener policies responseCOOP, + and ActiveDocumentCOOP:
+ +If the result of checking if
+ the navigation requires a browsing context group switch given
+ isInitialEmptyDocument, sandboxFlags, responseOrigin,
+ activeDocumentNavigationOrigin, responseCOOP's report-only value and
+ ActiveDocumentCOOPReportOnly's report-only value is false
,
+ return false
.
Matching report only policies allows a website to specify the same report only + Cross-Origin-Opener-Policy on all its pages and not receive violation reports for navigations + between these pages.
+If the result of checking if the navigation requires a
+ browsing context group switch given isInitialEmptyDocument,
+ sandboxFlags, responseOrigin, activeDocumentNavigationOrigin,
+ responseCOOP's value and
+ ActiveDocumentCOOPReportOnly's report-only
+ value is true
, return true
.
If the result of checking if the navigation requires a
+ browsing context group switch given isInitialEmptyDocument,
+ sandboxFlags, responseOrigin, activeDocumentNavigationOrigin,
+ responseCOOP's report-only value
+ and ActiveDocumentCOOPReportOnly's value is
+ true
, return true
.
Return false
.
A cross-origin opener policy enforcement result is + a struct composed of:
+ +A boolean needBrowsingContextGroupSwitch, initially false
.
A boolean needBrowsingContextGroupSwitchReportOnly, initially false
.
A boolean sameOriginWithPreviousDocumentIncludingRedirects, initally true
.
To check if a response requires a browsing context group switch, given a browsing context - browsingContext, an origin responseOrigin and a - cross-origin opener policy responseCOOP, run the followign steps:
+ browsingContext, an origin responseOrigin, a + cross-origin opener policy responseCOOP, and a cross-origin opener policy enforcement result + currentCOOPEnforcementResult, run the followign steps:Let activeDocumentNavigationOrigin be browsingContext's active document's origin.
If activeDocumentNavigationOrigin is not same origin with + responseOrigin, set currentCOOPEnforcementResult's + sameOriginWithPreviousDocumentIncludingRedirects to false.
Let activeDocumentCOOP be browsingContext's active document's cross-origin opener policy.
If the result of matching - activeDocumentCOOP, activeDocumentNavigationOrigin, - responseCOOP and responseOrigin is true, then return false.
If all of the following are true:
- -isInitialAboutBlank
If the result of checking if + the COOP values require a browsing context group switch given + isInitialAboutBlank, activeDocumentCOOP's value, activeDocumentNavigationOrigin, + responseCOOP's value and + responseOrigin is true, set currentCOOPEnforcementResult's + needBrowsingContextGroupSwitch to true.
activeDocumentCOOP is "same-origin-allow-popups
".
If the result of checking if + enforcing report only COOP policies would require a browsing context group switch given + isInitialAboutBlank, responseOrigin, + activeDocumentNavigationOrigin, responseCOOP, and + activeDocumentCOOP, is true, set currentCOOPEnforcementResult's + needBrowsingContextGroupSwitchReportOnly to true.
responseCOOP is "unsafe-none
".
If browsingContext's browsing context group's browsing
+ context set's size is strictly greater than 1
, then:
then return false.
+navigationCOOP's reporting endpoint is not null
and currentCOOPEnforcementResult's
+ needBrowsingContextGroupSwitch is true, queue a violation report for browsing context group switch
+ when navigating to a COOP page with navigationCOOP's reporting endpoint, navigationCOOP's
+ value, "enforce
",
+ response's URL,
+ browsingContext's active document's URL,
+ request's referrer, and
+ currentCOOPEnforcementResult's
+ sameOriginWithPreviousDocumentIncludingRedirects.
If navigationCOOP's report only reporting endpoint is not null
and currentCOOPEnforcementResult's
+ needBrowsingContextGroupSwitchReportOnly, queue a violation report for browsing context group switch
+ when navigating to a COOP page with navigationCOOP's report only reporting endpoint,
+ navigationCOOP's report only
+ value, "reporting
", response's URL, browsingContext's active
+ document's URL, and request's referrer.
Return true.
To obtain a browsing context to use for a navigation response, given a browsing context - browsingContext, a sandboxing flag set sandboxFlags, and a - cross-origin opener policy navigationCOOP:
+ browsingContext, a sandboxing flag set sandboxFlags, a + cross-origin opener policy navigationCOOP and a cross-origin opener policy enforcement result + COOPEnforcementResult:Assert browsingContext is a top-level browsing context.
Let activeDocumentCOOP be browsingContext's active + document's cross-origin opener + policy.
If COOPEnforcementResult's needBrowsingContextGroupSwitchReportOnly
+ is true
and browsingContext's browsing context
+ group's browsing context set's size is
+ strictly greater than 1
, and activeDocumentCOOP's report only reporting endpoint is not null
, then:
Let initialNavigationURL be a new empty URL.
If source and browsingContext are the same, set + initialNavigationURL to request's URL.
Queue a violation report for
+ browsing context group switch when navigating away from a COOP page with
+ activeDocumentCOOP's report only
+ reporting endpoint, activeDocumentCOOP's report only value, "reporting
", response's URL, browsingContext's active
+ document's URL, and initialNavigationURL.
If COOPEnforcementResult's needBrowsingContextGroupSwitch is false
, return browsingContext.
+
+
If browsingContext's browsing context group's browsing context
+ set's size is strictly greater than 1
, and activeDocumentCOOP's reporting endpoint is not null
, then:
Let initialNavigationURL be a new empty URL.
If source and browsingContext are the same, set + initialNavigationURL to request's URL.
Queue a violation report for
+ browsing context group switch when navigating away from a COOP page with
+ activeDocumentCOOP's reporting
+ endpoint, activeDocumentCOOP's value,
+ "enforce
", response's URL, browsingContext's active
+ document's URL, and initialNavigationURL.
Let newBrowsingContext be the result of creating a new top-level browsing context.
If navigationCOOP is " If navigationCOOP's value is "same-origin-plus-COEP
", then set
newBrowsingContext's group's cross-origin isolated to true.
If sandboxFlags is not empty, then:
Assert: navigationCOOP is "unsafe-none
".
Assert navigationCOOP's value is
+ "unsafe-none
".
Set newBrowsingContext's sandboxing flag set to sandboxFlags.
To queue a violation report for browsing context group + switch when navigating to a COOP page given a string endpoint, a cross-origin opener policy value + COOPValue, a string disposition, a URL + navigationURL, a URL currentDocumentURL, and a + referrer referrer:
+ +
Let previousDocumentURL be referrer.
If currentDocumentURL and navigationURL are + same origin, set previousDocumentURL to + currentDocumentURL.
Set previousDocumentURL's username
+ to the empty string, and its password to null
.
Let serializedPreviousDocumentURL be the result of executing the URL serializer on previousDocumentURL with the + exclude fragment flag set.
Let body be a new object containing the following properties with keys:
+ +key: "disposition
", value: disposition.
key: "effective-policy
", value: COOPValue.
key: "navigation-uri
", value:
+ serializedPreviousDocumentURL.
key: "violation-type
", value: "navigate-to-document
".
Queue body as "coop
"
+ for endpoint with navigationURL.
To queue a violation report for browsing context group + switch when navigating away from a COOP page given a string endpoint, a + cross-origin opener policy value COOPValue, a string + disposition, a URL navigationURL, a URL + currentDocumentURL, and a URL initialNavigationURL:
+ +
Let nextDocumentURL be initialNavigationURL.
If currentDocumentURL and navigationURL are + same origin, set nextDocumentURL to + navigationURL.
Set nextDocumentURL's username to
+ the empty string, and its password to null
.
Let serializedNextDocumentURL be the result of executing the URL serializer on nextDocumentURL with the + exclude fragment flag set.
Let body be a new object containing the following properties with keys:
+ +key: "disposition
", value: disposition.
key: "effective-policy
", value: COOPValue.
key: "navigation-uri
", value:
+ serializedNextDocumentURL.
key: "violation-type
", value: "navigate-from-document
".
Queue body as "coop
"
+ for endpoint with currentDocumentURL.
Let responseCOOP be "unsafe-none
".
Let responseCOOP be a new cross-origin opener policy.
Let browsingContextSwitchNeeded be false.
Let COOPEnforcementResult be a new cross-origin opener policy enforcement + result.
Run process a navigate response with null, resource, navigationType, the source browsing context, browsingContext, finalSandboxFlags, responseOrigin, incumbentNavigationOrigin, activeDocumentNavigationOrigin, null, - responseCOOP, and browsingContextSwitchNeeded.
Run process a navigate response with resource, response, navigationType, the source browsing context, browsingContext, finalSandboxFlags, activeDocumentNavigationOrigin, incumbentNavigationOrigin, activeDocumentNavigationOrigin, null, browsingContext's active document's cross-origin opener - policy, and false.
So for example a Let responseOrigin be null.
- Let browsingContextSwitchNeeded be false. Let COOPEnforcementResult be a cross-origin opener policy enforcement result. Let finalSandboxFlags be an empty sandboxing flag set.
This results in a network error as one cannot simultaneously provide a - clean slate to a response using cross-origin opener policy and sandbox the result of +
This results in a network error as one cannot simultaneously provide a + clean slate to a response using cross-origin opener policy and sandbox the result of navigating to that response.
-Let responseRequiresBrowsingContexGroupSwitch be the result of checking if the response requires a - browsing context group switch given browsingContext, - responseOrigin, and responseCOOP.
If responseRequiresBrowsingContextGroupSwitch is true, set - browsingContextSwitchNeeded to true.
Check if the response + requires a browsing context group switch given browsingContext, + responseOrigin, responseCOOP, and + COOPEnforcementResult.
text/vtt
"multipart/x-mixed-replace
"An explicitly supported XML MIME type is an XML MIME type for which @@ -82650,18 +83027,21 @@ interface Location { // but see also type type, content type contentType, a request request, a response response, a browsing context browsingContext, a sandboxing flag set - finalSandboxFlags, three origins origin, - incumbentNavigationOrigin, activeDocumentNavigationOrigin, null or an + data-x="concept-response">response response, two browsing contexts source, and browsingContext, a + sandboxing flag set finalSandboxFlags, three origins origin, incumbentNavigationOrigin, + activeDocumentNavigationOrigin, null or an environment reservedEnvironment, a cross-origin opener policy - navigationCOOP, and a boolean browsingContextSwitchNeeded:
+ navigationCOOP, and a cross-origin opener + policy enforcement result COOPEnforcementResult:If browsingContextSwitchNeeded is true, set browsingContext to the - result of the obtain a browsing context to use - for a navigation response algorithm, given browsingContext, - finalSandboxFlagSet, and navigationCOOP.
Set browsingContext to the result of the obtain a browsing context to use for a navigation + response algorithm, given request, response, source, + browsingContext, finalSandboxFlagSet, navigationCOOP, and + COOPEnforcementResult.
Let featurePolicy be the result of creating a feature policy from a
@@ -82947,20 +83327,20 @@ new PaymentRequest(…); // Allowed to use
When an HTML document is to be loaded, given a
- browsingContext, request, response, finalSandboxFlags,
- finalResponseOrigin, incumbentNavigationOrigin,
+ source, browsingContext, request, response,
+ finalSandboxFlags, finalResponseOrigin, incumbentNavigationOrigin,
activeDocumentNavigationOrigin, environment, responseCOOP, and
- browsingContextSwitchNeeded the user agent must queue a task on the
+ COOPEnforcementResult the user agent must queue a task on the
networking task source to: Let document be the result of creating and initializing a Page load processing model for HTML files
Document
object providing "html
", "text/html
",
- request, response, browsingContext, finalSandboxFlags,
- finalResponseOrigin, incumbentNavigationOrigin,
- activeDocumentNavigationOrigin, environment, responseCOOP, and
- browsingContextSwitchNeeded.
Create an HTML parser and associate it with the document. Each @@ -82993,19 +83373,20 @@ new PaymentRequest(…); // Allowed to use
When faced with displaying an XML file inline, provided browsingContext, - request, response, finalSandboxFlags, +
When faced with displaying an XML file inline, provided source,
+ browsingContext, request, response, finalSandboxFlags,
finalResponseOrigin, incumbentNavigationOrigin,
activeDocumentNavigationOrigin, environment,responseCOOP, and
- browsingContextSwitchNeeded user agents must follow the requirements defined in
- XML and Namespaces in XML, XML Media Types, DOM,
- and other relevant specifications to create and
- initialize a Document
object providing "xml
",
- type, request, response, browsingContext,
- finalSandboxFlags, finalResponseOrigin incumbentNavigationOrigin,
+ COOPEnforcementResult user agents must follow the requirements defined in
+ XML and Namespaces in XML, XML Media Types,
+ DOM, and other relevant specifications to create and initialize a Document
object
+ providing "xml
", type, request, response,
+ source, browsingContext, finalSandboxFlags,
+ finalResponseOrigin incumbentNavigationOrigin,
activeDocumentNavigationOrigin, environment, responseCOOP. and
- browsingContextSwitchNeeded. It must also create and a corresponding XML
- parser.
At the time of writing, the XML specification community had not actually yet specified how XML and the DOM interact.
@@ -83049,21 +83430,21 @@ new PaymentRequest(…); // Allowed to useWhen a plain text document is to be loaded, provided a browsingContext, - request, response, finalSandboxFlags, +
When a plain text document is to be loaded, provided source, + browsingContext, request, response, finalSandboxFlags, finalResponseOrigin, incumbentNavigationOrigin, activeDocumentNavigationOrigin, environment,responseCOOP, and - browsingContextSwitchNeeded the user agent must queue a task on the + COOPEnforcementResult the user agent must queue a task on the networking task source to:
Let document be the result of creating and initialize a Document
object
providing "html
", type, request,
- response, browsingContext, finalSandboxFlags,
+ response, source, browsingContext, finalSandboxFlags,
finalResponseOrigin, incumbentNavigationOrigin,
activeDocumentNavigationOrigin, environment, responseCOOP, and
- browsingContextSwitchNeeded.
Create an HTML parser and associate it with the document. Act as if the tokenizer had emitted a start tag token with the tag name "pre" followed by a single @@ -83130,20 +83511,20 @@ new PaymentRequest(…); // Allowed to use
When an image, video, or audio resource is to be loaded, provided a browsingContext, - request, response, finalSandboxFlags, +
When an image, video, or audio resource is to be loaded, provided source, + browsingContext, request, response, finalSandboxFlags, finalResponseOrigin, incumbentNavigationOrigin, activeDocumentNavigationOrigin, environment, responseCOOP, - browsingContextSwitchNeeded, the user agent should: + COOPEnforcementResult, the user agent should:
Let document be the result of creating and initialize a Document
object
providing "html
", type, request,
- response, browsingContext, finalSandboxFlags,
+ response, source, browsingContext, finalSandboxFlags,
finalResponseOrigin, incumbentNavigationOrigin,
activeDocumentNavigationOrigin, environment, responseCOOP, and
- browsingContextSwitchNeeded.
Append an html
element to document.
When a resource that requires an external resource to be rendered is to be loaded, provided a - browsingContext, request, response, sandboxFlags, - finalResponseOrigin, incumbentNavigationOrigin, + source, browsingContext, request, response, + finalSandboxFlags, finalResponseOrigin, incumbentNavigationOrigin, activeDocumentNavigationOrigin, environment, responseCOOP, and - browsingContextSwitchNeeded, the user agent should: + COOPEnforcementResult, the user agent should:
Let document be the result of creating and initialize a Document
object
providing "html
", type, request,
- response, browsingContext, finalSandboxFlags,
+ response, source, browsingContext, finalSandboxFlags,
finalResponseOrigin, incumbentNavigationOrigin,
activeDocumentNavigationOrigin, environment, responseCOOP, and
- browsingContextSwitchNeeded.
Mark document as being a plugin document
When the user agent is to display a user agent page inline, the user agent should create and initialize a Document
object
- providing "html
", "text/html
", null, null,
- browsingContext, an empty set, null, null, and null, and then either associate that
- Document
with a custom rendering that is not rendered using the normal
- Document
rendering rules, or mutate that Document
until it represents
- the content the user agent wants to render.
html
", "text/html
", null, null, null,
+ browsingContext, an empty set, null, null, null, a new cross-origin opener
+ policy, and false and then either associate that Document
with a custom
+ rendering that is not rendered using the normal Document
rendering rules, or mutate
+ that Document
until it represents the content the user agent wants to render.
@@ -116213,6 +116594,30 @@ interface External {
+ Cross-Origin-Opener-Policy-Report-Only
`This section describes a header for registration in the Permanent Message Header Field + Registry.
+ +Ping-From
`This section describes a header for registration in the Permanent Message Header Field @@ -116354,6 +116759,7 @@ interface External { +