@@ -4,7 +4,7 @@ CoreWebView2Frame.FrameCreated API
44# Background
55At present, WebView2 enables developers to track only first-level
66iframes, which are the direct child iframes of the main frame.
7- However, we're noticing WebView2 customers want to manage nested
7+ However, we see that WebView2 customers want to manage nested
88iframes, such as recording the navigation history for a nested
99iframe. To address this, we will introduce the
1010` CoreWebView2Frame.FrameCreated ` API. This new API will allow
@@ -13,12 +13,14 @@ giving them access to all properties, methods, and events of
1313[ CoreWebView2Frame] ( https://learn.microsoft.com/dotnet/api/microsoft.web.webview2.core.corewebview2frame )
1414for the nested iframe.
1515
16- To prevent unnecessary performance overhead, WebView2 does not track
17- any nested iframes by default. It only tracks a nested iframe if its
18- parent iframe(` CoreWebView2Frame ` ) has subscribed to the
19- ` CoreWebView2Frame.FrameCreated ` API. Therefore, WebView2 developers
20- have the flexibility to choose whether they want to track specific
21- branches of the iframe tree or all WebView2 iframes.
16+ To prevent unnecessary performance implication, WebView2 does
17+ not track any nested iframes by default. It only tracks a nested
18+ iframe if its parent iframe(` CoreWebView2Frame ` ) has subscribed
19+ to the ` CoreWebView2Frame.FrameCreated ` API. For a page with
20+ multi-level iframes, developers can choose to track only the
21+ main page and first-level iframes (the default behavior), a
22+ partial WebView2 frames tree with specific iframes of interest,
23+ or the full WebView2 frames tree.
2224
2325# Examples
2426### C++ Sample
@@ -182,7 +184,7 @@ void HandleChildFrameCreated(object sender, CoreWebView2FrameCreatedEventArgs ar
182184 CoreWebView2Frame childFrame = args.Frame;
183185 string name = String.IsNullOrEmpty(childFrame.Name) ? "none" : childFrame.Name;
184186 MessageBox.Show(this, "Id: " + childFrame.FrameId + " name: " + name, "Child frame created", MessageBoxButton.OK);
185- // Make a recursive call to track all nested webview2 frames events.
187+ // Make a recursive call to track all nested webview frames events.
186188 childFrame.FrameCreated += HandleChildFrameCreated;
187189 childFrame.NavigationStarting += HandleChildFrameNavigationStarting;
188190 childFrame.ContentLoading += HandleChildFrameContentLoading;
0 commit comments