You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specs/AdditionalAllowedFrameAncestors.md
+72-72Lines changed: 72 additions & 72 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,67 +7,65 @@ Due to potential [Clickjacking](https://en.wikipedia.org/wiki/Clickjacking) att
7
7
However, there are application scenarios that require hosting these sites in the app's UI that is authored as an HTML page.
8
8
`<webview>` HTML element was provided for these hosting scenarios in previous solutions like Electron and JavaScript UWP apps.
9
9
10
-
For WebView2, we are providing a native API for these hosting scenarios. It let the developers to provide additional allowed frame ancestors as if the site sent these as part of the Content-Security-Policy frame-ancestors directive. An ancestor is allowed if it is allowed by the site's origional http headers or by this addtional allowed frame ancestors.
10
+
For WebView2, we are providing a native API for these hosting scenarios. Developers can use it to provide additional allowed frame ancestors as if the site sent these as part of the Content-Security-Policy frame-ancestors directive. The result is that an ancestor is allowed if it is allowed by the site's origional policies or by this addtional allowed frame ancestors.
11
11
12
12
# Conceptual pages (How To)
13
13
14
-
To host other sites in an trusted page
14
+
To host other sites in an trusted page with modified allowed frame ancestors
15
15
- Listen to FrameNavigationStarting event of CoreWebView2.
16
-
- Set AdditionalAllowedFrameAncestors property of the NavigationStartingEventArgs to a list of trusted origins that is hosting the site.
16
+
- Set AdditionalAllowedFrameAncestors property of the NavigationStartingEventArgs to a list additional allowed frame ancestors using the same syntax as [Content-Security-Policy frame-ancestors directive](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors).
17
17
18
18
The list should normally only contain the origin of the top page.
19
-
If you are hosting other sites through nested iframes and the origins of some of the intermediate iframes are different from the origin of the top page, the list should also include those origins.
19
+
If you are hosting other sites through nested iframes and the origins of some of the intermediate iframes are different from the origin of the top page and those origins might not be allowed by the site's original policies, the list should also include those origins.
20
20
21
-
You should only add an origin to the list if it is fully trusted. You should limit the usage of the API to the targetted iframes whenever possible.
21
+
You should only add an origin to the list if it is fully trusted. You should limit the usage of the API to the targetted app scenarios.
0 commit comments