@@ -2,31 +2,28 @@ CoreWebView2Frame.FrameCreated API
22===
33
44# Background
5- At present, WebView2 enables developers to track only
6- first-level iframes, which are the direct child frames
7- of the main frame. However, we're noticing WebView2
8- customers want to manage nested iframes, such as
9- recording the navigation history for a nested iframe.
10- To address this, we will introduce the
5+ At present, WebView2 enables developers to track only first-level
6+ iframes, which are the direct child iframes of the main frame.
7+ However, we're noticing WebView2 customers want to manage nested
8+ iframes, such as recording the navigation history for a nested
9+ iframe. To address this, we will introduce the
1110` CoreWebView2Frame.FrameCreated ` API. This new API will allow
12- developers to subscribe to the event when a nested WebView frame
13- is created, giving them access to all properties, methods, and
14- events of [ CoreWebView2Frame] ( https://learn.microsoft.com/dotnet/api/microsoft.web.webview2.core.corewebview2frame )
15- for the nested WebView frame .
11+ developers to subscribe to the nested iframe creation event,
12+ giving them access to all properties, methods, and events of
13+ [ CoreWebView2Frame] ( https://learn.microsoft.com/dotnet/api/microsoft.web.webview2.core.corewebview2frame )
14+ for the nested iframe .
1615
17- To prevent unnecessary performance overhead, WebView2
18- does not track any nested WebView frames by default.
19- It only tracks a webview2 frame if its parent webview2
20- frame has subscribed to the ` CoreWebView2Frame.FrameCreated `
21- API. Therefore, WebView2 developers have the flexibility
22- to choose whether they want to track specific branches of
23- the frame tree or all webview2 frames.
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.
2422
2523# Examples
2624### C++ Sample
2725``` cpp
2826EventRegistrationToken m_frameCreatedToken = {};
29-
3027void PostFrameCreatedEventMessage (wil::com_ptr<ICoreWebView2Frame > webviewFrame);
3128
3229void ScenarioWebViewEventMonitor::InitializeEventView(ICoreWebView2* webviewEventView)
@@ -243,7 +240,7 @@ interface ICoreWebView2Frame7 : IUnknown {
243240 /// Use `ICoreWebView2Frame.add_Destroyed` to listen for when this
244241 /// iframe goes away.
245242 ///
246- /// \snippet ScenarioWebViewEventMonitor.cpp FrameCreated
243+ /// \snippet ScenarioWebViewEventMonitor.cpp AddFrameCreated
247244 HRESULT add_FrameCreated(
248245 [in] ICoreWebView2FrameNestedFrameCreatedEventHandler* eventHandler,
249246 [out] EventRegistrationToken* token);
0 commit comments