diff --git a/source b/source index f6c84b41ad4..3f1de86978a 100644 --- a/source +++ b/source @@ -2654,6 +2654,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
The following terms are defined in Referrer Policy: start an idle period algorithm
+
+ The following feature is defined in Cross-Origin Embedder Policy:
+
+
@@ -8986,6 +9003,11 @@ partial interface Document {
data-x="concept-document-module-map">module map, which is a module map,
initially empty.
The Document
has a cross-origin opener policy, which is a
+ cross-origin opener policy,
+ initially "unsafe-none
".
DocumentOrShadowRoot
interfaceDOM defines the setting up a window environment settings object given realm
execution context and topLevelOrigin.
Let COOP be a cross-origin-opener-policy with value "unsafe-none
".
If creator is non-null, let creatorOrigin be its origin
+ and let creatorTopLevelOrigin be its top-level origin. If
+ creatorOrigin is same origin with creatorTopLevelOrigin, then
+ set COOP to creator's top-level browsing context's
+ 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
",
origin is origin, active sandboxing flag set is
sandboxFlags, feature policy is
- feature policy, and which is both ready for post-load tasks and
- completely loaded immediately.
Ensure that document has a single child html
node, which itself
has two empty child nodes: a head
element, and a body
element.
A browsing context group has a cross-origin isolated boolean. It is initially false.
+ +The impact of cross-origin + isolated is under discussion in issue + #4734.
+To create a new browsing context group, run these steps:
@@ -77300,6 +77341,27 @@ 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:
Let currentDocument be current's + active document.
If currentDocument's origin is not same origin
+ with current's top-level origin, then set noopener to
+ true and name to "_blank
".
In the presence of COOP, nested documents cross-origin with their + top-level browsing context always set /noopener/.
+Set new to true.
If noopener is true, then set chosen to the result @@ -79736,6 +79798,184 @@ interface BarProp { +
A cross-origin opener policy restricts the set
+ of browsing contexts which can live together in a single
+ browsing context group. It has one of the following values, defaulting to "unsafe-none
" unless otherwise specified:
unsafe-none
"The default value of the cross-origin opener + policy. Documents with this policy can share their + browsing context group with any other document that has the same + policy, regardless of their top-level origin.
same-origin-allow-popups
"When this policy is enabled, documents will be placed in a + new browsing context group when their opener's top-level origin is not + same-origin with them. Documents with this policy are still able + to open cross-origin popups in their browsing context group.
same-origin
"When this policy is enabled on a document, its browsing context + group will only contain documents with the same + top-level origin and the same policy.
same-origin-plus-COEP
"This policy is meant to provide the highest degree of isolation to pages. When enabled on a + document, its browsing context group will only contain + documents with the same top-level origin and the + same policy. The browsing context group will also be cross-origin isolated.
+ +"same-origin-plus-COEP
" cannot be directly set via the
+ `Cross-Origin-Opener-Policy
` header, but
+ results from a combination of setting both Cross-Origin-Opener-Policy:
+ same-origin
and Cross-Origin-Embedder-Policy: require-corp
+ together.
To obtain a cross-origin opener policy from a response response and an environment + environment:
+ +Let securityState be the result of executing Is environment + settings object a secure context? on environment.
If securityState is "Not Secure
", then return "unsafe-none
".
Let value be the result of getting
+ `Cross-Origin-Opener-Policy
` from
+ response's header list.
If value is null, then return "unsafe-none
".
Let decodedValue be the isomorphic + decoding of value
If decodedValue is not "same-origin
" or "same-origin-allow-popups
", then return "unsafe-none
".
If decodedValue is "same-origin
", then:
Let COEP be the result of obtaining a cross-origin embedder policy from + response.
If COEP is "require-corp
", then return "same-origin-plus-COEP
".
Return decodedValue
To match cross-origin opener policies, given a COOP A, an origin + originA, a COOP B and an + origin originB:
+ +If A is "unsafe-none
" and B is "unsafe-none
", then return true.
If A or B is "unsafe-none
", then return
+ false.
If A is the same value as B and + originA is same origin with originB, then + return true.
Return false.
To obtain a browsing context to use for a + navigation response, given a response + response, a browsing context + browsingContext, a sandboxing flag set sandboxFlags, two origins incumbentNavigationOrigin, + activeDocumentNavigationOrigin, and a cross-origin opener policy + responseCOOP:
+ +Let activeDocumentCOOP be the + cross-origin opener policy of currentBrowsingContext's active + document.
If the result of matching + activeDocumentCOOP, activeDocumentNavigationOrigin, + responseCOOP and incumbentNavigationOrigin is true, return + browsingContext.
If all of the following are true:
+ +currentBrowsingContext's only entry in its session history is
+ the about:blank
Document
that was added when
+ browsingContext was created.
activeDocumentCOOP is "same-origin-allow-popups
".
responseCOOP is "unsafe-none
".
then return browsingContext.
+Let newBrowsingContextGroup be the result of creating a new + browsing context group.
If responseCOOP is "same-origin-plus-COEP
", then set
+ newBrowsingContextGroup cross-origin
+ isolated to true.
Let newBrowsingContext be the result of creating a new browsingContext in newBrowsingContextGroup.
If sandboxFlags is not empty, then:
+Assert responseCOOP is "unsafe-none
".
Set newBrowsingContext's sandboxing flag set to + sandboxFlags.
Discard + currentBrowsingContext.
+ +This does not close currentBrowsingContext's browsing context + group except if it was the sole top-level browsing context in which case it could be + collected
+Return newBrowsingContext.
The impact of swapping browsing context groups following a navigation is not + defined. It is currently under discussion in issue 5350.
+ + +If browsingContext is a top-level browsing context, then:
+ +Set incumbentCOOP to the cross-origin opener policy obtained given response and + reservedEnvironment.
If sandboxFlags is not empty and incumbentCOOP is not "unsafe-none
", then display the inline
+ content with an appropriate error shown to the user, with the newly created
+ Document
object's origin set to a new opaque origin, run the environment discarding steps for reservedEnvironment, and
+ return.
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 newBrowsingContext be the value of obtaining a browsing context for the navigation + response given response, browsingContext, sandboxFlags, + incumbentNavigationOrigin, activeDocumentNavigationOrigin, and + incumbentCOOP.
Let browsingContextSwitch be false.
If newBrowsingContext is not equal to browsingContext, then set + browsingContextSwitch to true.
Set browsingContext to the value of newBrowsingContext.
If browsingContext's only entry in its session history is the
initial about:blank
Document
that was added when
browsingContext was created, and
@@ -82134,8 +82413,9 @@ interface Location { // but see also type is type, content type is contentType,
origin is origin, feature
- policy is featurePolicy, and active sandboxing flag set is
- finalSandboxFlags.
If request is non-null, then set document's URL to request's @@ -115745,6 +116025,27 @@ interface External { +
Cross-Origin-Opener-Policy
`This section describes a header for registration in the Permanent Message Header Field + Registry.
+ +