{"id":3702,"date":"2020-01-30T11:43:56","date_gmt":"2020-01-30T09:43:56","guid":{"rendered":"https:\/\/mariusbancila.ro\/blog\/?p=3702"},"modified":"2023-04-05T08:06:27","modified_gmt":"2023-04-05T06:06:27","slug":"using-microsoft-edge-in-a-native-windows-desktop-app-part-3","status":"publish","type":"post","link":"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/","title":{"rendered":"Using Microsoft Edge in a native Windows desktop app \u2013 part 3"},"content":{"rendered":"<p class=\"tip-lite\">This article has been updated for the version of WebView2 that requires Microsoft Edge WebView2 Runtime 88.0.705.50 or newer.<\/p>\n<p>In the previous article, we learned how to create a web view and display web content in a Windows desktop application. In this third article of the series, we will look in detail at navigation and handling events, in general.<\/p>\n<p><!-- more --><\/p>\n<div class=\"tip-lite\">Articles in this series:<\/p>\n<ul>\n<li><a href=\"https:\/\/mariusbancila.ro\/blog\/2020\/01\/28\/using-microsoft-edge-in-a-native-windows-desktop-app-part-1\/\">Part 1: Introduction to Edge and WebView2<\/a><\/li>\n<li><a href=\"https:\/\/mariusbancila.ro\/blog\/2020\/01\/29\/using-microsoft-edge-in-a-native-windows-desktop-app-part-2\/\">Part 2: Creating a WebView2 component<\/a><\/li>\n<li>Part 3: Navigation and other events<\/li>\n<li><a href=\"https:\/\/mariusbancila.ro\/blog\/2021\/01\/27\/using-microsoft-edge-in-a-native-windows-desktop-app-part-4\/\">Part 4: Performing navigation with custom data and headers<\/a><\/li>\n<li><a title=\"\" href=\"https:\/\/mariusbancila.ro\/blog\/2023\/03\/21\/using-microsoft-edge-in-a-native-windows-desktop-app-part-5\/\" target=\"_blank\" rel=\"noopener\">Part 5: Executing JavaScript code<\/a><\/li>\n<li><a title=\"\" href=\"https:\/\/mariusbancila.ro\/blog\/2023\/04\/05\/using-microsoft-edge-in-a-native-windows-desktop-app-part-6\/\" target=\"_blank\" rel=\"noopener\">Part 6: Printing a web page<\/a><\/li>\n<\/ul>\n<\/div>\n<h2>Navigation overview<\/h2>\n<p>To navigate to a web URL you must use the method <tt>Navigate()<\/tt> from the <a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2\" target=\"_blank\" rel=\"noopener noreferrer\">ICoreWebView2<\/a> interface. The only argument this method takes is the URL of the web page. However, you must specify the scheme, such as <tt>http:\/\/<\/tt> or <tt>https:\/\/<\/tt> or <tt>file:\/\/<\/tt>. URLs of the form <em>www.bing.com<\/em> or simply <em>bing.com<\/em> do not work. For this reason, in the code shown in the previous article, you can see this helper method for navigating:<\/p>\n<pre class=\"lang:c++ decode:true \">CString CWebBrowser::NormalizeUrl(CString url)\n{\n   if (url.Find(_T(\":\/\/\")) &lt; 0)\n   {\n      if (url.GetLength() &gt; 1 &amp;&amp; url[1] == ':')\n         url = _T(\"file:\/\/\") + url;\n      else\n         url = _T(\"http:\/\/\") + url;\n   }\n\n   return url;\n}\n\nvoid CWebBrowser::NavigateTo(CString url)\n{\n   m_pImpl-&gt;m_webView-&gt;Navigate(NormalizeUrl(url));\n}<\/pre>\n<p>What is happening here, we look if the URL contains :\/\/. If it does not, but it starts with something like C: then we prefix it with file:\/\/, otherwise with http:\/\/.<\/p>\n<p>During navigation, the web view control generates several events, as follows:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3756\" src=\"https:\/\/mariusbancila.ro\/blog\/wp-content\/uploads\/2020\/01\/dot_inline_dotgraph_1.png\" alt=\"\" width=\"526\" height=\"583\" srcset=\"https:\/\/mariusbancila.ro\/blog\/wp-content\/uploads\/2020\/01\/dot_inline_dotgraph_1.png 526w, https:\/\/mariusbancila.ro\/blog\/wp-content\/uploads\/2020\/01\/dot_inline_dotgraph_1-271x300.png 271w\" sizes=\"auto, (max-width: 526px) 100vw, 526px\" \/><br \/>\n(Source: <a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#navigation-events\" target=\"_blank\" rel=\"noopener noreferrer\">docs.microsoft.com<\/a>)<\/p>\n<p><tt>NavigationStarting<\/tt> is the first event, generated when navigation begins. If HTTP redirection occurs, then multiple <tt>NavigationStarting<\/tt> events will be fired. When navigation completes, the event <tt>NavigationCompleted<\/tt> is fired. In between these, <tt>SourceChanged<\/tt>, <tt>ContentLoading<\/tt>, and <tt>HistoryChanged<\/tt> events may be generated.<\/p>\n<p>You can learn more about navigation events <a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#navigation-events\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<p>If you want to display some HTML content that you have locally, or generated on the fly, and you do not actually need to go to the web, you can use the method <tt>NavigateToString()<\/tt> that will display the HTML content provided as a string.<\/p>\n<h2>Handling navigation events<\/h2>\n<p>To handle web content events, you must register handlers. You can do this using the <tt>ICoreWebView2<\/tt> interface. For instance, to handle <tt>NavigationStarting<\/tt> and <tt>NavigationCompleted<\/tt>, call <a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_navigationstarting\" target=\"_blank\" rel=\"noopener noreferrer\">add_NavigationStarting<\/a> and <a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_navigationcompleted\" target=\"_blank\" rel=\"noopener noreferrer\">add_NavigationCompleted<\/a>. If you no longer wish to handle these events, you can remove the handlers by calling <a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_navigationstarting\" target=\"_blank\" rel=\"noopener noreferrer\">remove_NavigationStarting<\/a> and <a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_navigationcompleted\" target=\"_blank\" rel=\"noopener noreferrer\">remove_NavigationCompleted<\/a>.<\/p>\n<p>The same approach for registering and unregistering event handlers applies to all events. For an event <tt>X<\/tt> there is an <tt>add_X()<\/tt> and <tt>remove_X()<\/tt> pair of methods to add and remove handlers.<\/p>\n<p>You can only register events after the web view control has been created and you have a valid pointer to the <tt>ICoreWebView2<\/tt> interface. In the sample application, and the code shown in the previous article, the method <tt>OnCreateWebViewCompleted()<\/tt> contained a call to <tt>RegisterEventHandlers()<\/tt>. In this method, we add the handlers for the two navigation events.<\/p>\n<pre class=\"lang:c++ decode:true \">void CWebBrowser::RegisterEventHandlers()\n{\n   \/\/ NavigationCompleted handler\n   CHECK_FAILURE(m_pImpl-&gt;m_webView-&gt;add_NavigationCompleted(\n      Callback&lt;ICoreWebView2NavigationCompletedEventHandler&gt;(\n         [this](\n            ICoreWebView2*, \n            ICoreWebView2NavigationCompletedEventArgs* args) -&gt; HRESULT\n         {\n            m_isNavigating = false;\n\n            BOOL success;\n            CHECK_FAILURE(args-&gt;get_IsSuccess(&amp;success));\n\n            if (!success)\n            {\n               COREWEBVIEW2_WEB_ERROR_STATUS webErrorStatus{};\n               CHECK_FAILURE(args-&gt;get_WebErrorStatus(&amp;webErrorStatus));\n               if (webErrorStatus == COREWEBVIEW2_WEB_ERROR_STATUS_DISCONNECTED)\n               {\n                  \/\/ Do something here if you want to handle a specific error case.\n                  \/\/ In most cases this isn't necessary, because the WebView will\n                  \/\/ display its own error page automatically.\n               }\n            }\n\n            wil::unique_cotaskmem_string uri;\n            m_pImpl-&gt;m_webView-&gt;get_Source(&amp;uri);\n\n            if (wcscmp(uri.get(), L\"about:blank\") == 0)\n            {\n               uri = wil::make_cotaskmem_string(L\"\");\n            }\n\n            auto callback = m_callbacks[CallbackType::NavigationCompleted];\n            if (callback != nullptr)\n               RunAsync(callback);\n\n            return S_OK;\n         })\n      .Get(),\n            &amp;m_navigationCompletedToken));\n\n   \/\/ NavigationStarting handler\n   CHECK_FAILURE(m_pImpl-&gt;m_webView-&gt;add_NavigationStarting(\n      Callback&lt;ICoreWebView2NavigationStartingEventHandler&gt;(\n         [this](\n            ICoreWebView2*,\n            ICoreWebView2NavigationStartingEventArgs* args) -&gt; HRESULT\n         {\n            wil::unique_cotaskmem_string uri;\n            CHECK_FAILURE(args-&gt;get_Uri(&amp;uri));\n\n            m_isNavigating = true;\n            \n            return S_OK;\n         }).Get(), &amp;m_navigationStartingToken));\n}<\/pre>\n<p>The functions <tt>add_NavigationStarting()<\/tt> and <tt>add_NavigationCompleted<\/tt>, as well as the other event handler registration methods, take two arguments: the first is a pointer to a callback that is invoked when the event occurs, and the second is a pointer to a <tt>EventRegistrationToken<\/tt> object, which represent a reference to a delegate (the callback) that receives change notifications. This token is set by the function and must be passed to the method that removes the event handler. In other words, the token received from <tt>add_NavigationStarting()<\/tt> must be passed to <tt>remove_NavigationStarting()<\/tt> in order to be able to remove the event handler.<\/p>\n<p>What we do in the event handlers above is the following. At the start of the navigation, we only set a Boolean flag that indicates that the navigation is in progress. We need this for instance if we want to have a button that we can press to stop loading a page if that takes too long. At the end of the navigation, the flag is reset but we also invoke a callback, if any was set by the caller when starting the navigation. In the demo app, we use a callback for the navigation completion from the main frame in order to update the URL in the toolbar with the URL resulted after the navigation, which may not be the original one (because HTTP redirects can occur).<\/p>\n<p>In the previous article, we saw a method called <tt>CloseWebView()<\/tt> what closed the web view control. Here is the method updated with removing handlers for the navigation events.<\/p>\n<pre class=\"lang:c++ decode:true \">void CWebBrowser::CloseWebView()\n{\n   if (m_pImpl-&gt;m_webView)\n   {\n      m_pImpl-&gt;m_webView-&gt;remove_NavigationCompleted(m_navigationCompletedToken);\n      m_pImpl-&gt;m_webView-&gt;remove_NavigationStarting(m_navigationStartingToken);\n\n      m_pImpl-&gt;m_webController-&gt;Close();\n\n      m_pImpl-&gt;m_webController = nullptr;\n      m_pImpl-&gt;m_webView = nullptr;\n      m_pImpl-&gt;m_webSettings = nullptr;\n   }\n\n   m_pImpl-&gt;m_webViewEnvironment = nullptr;\n}<\/pre>\n<h2>Handling other events<\/h2>\n<p>Let us look at another example for handling events. For this purpose we will consider the <tt>DocumentTitleChanged<\/tt> event that is occurring when the <tt>DocumentTitle<\/tt> property of the web view changes. This may occur before or after the <tt>NavigationCompleted<\/tt> event. To add\/remove a handler for this event, you need a pointer to the <tt>ICoreWebView2<\/tt> interface.<\/p>\n<p>We can handle this event as follows, by adding a handler in the <tt>RegisterEventHandlers<\/tt> method we saw above.<\/p>\n<pre class=\"lang:c++ decode:true \">CHECK_FAILURE(m_pImpl-&gt;m_webView-&gt;add_DocumentTitleChanged(\n   Callback&lt;ICoreWebView2DocumentTitleChangedEventHandler&gt;(\n      [this](ICoreWebView2* sender, IUnknown* args) -&gt; HRESULT {\n         wil::unique_cotaskmem_string title;\n         CHECK_FAILURE(sender-&gt;get_DocumentTitle(&amp;title));\n\n         m_strTitle = title.get();\n         \n         auto callback = m_callbacks[CallbackType::TitleChanged];\n         if (callback != nullptr)\n            RunAsync(callback);\n\n         return S_OK;\n      })\n   .Get(), &amp;m_documentTitleChangedToken));<\/pre>\n<p>What we do here, is retrieving the title of the document and storing it in the class. Then, if a callback was set for this event we invoke it. We can modify the creation of the web view and install a callback for this event so that every time a page is loaded and the title changes we update the title of the main window of the application.<\/p>\n<pre class=\"lang:c++ decode:true \">void CMfcEdgeDemoView::OnInitialUpdate()\n{\n   CView::OnInitialUpdate();\n\n   this-&gt;ModifyStyleEx(WS_EX_CLIENTEDGE | WS_EX_WINDOWEDGE, 0, 0);\n   this-&gt;ModifyStyle(WS_CAPTION | WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_THICKFRAME | WS_BORDER, 0, 0);\n\n   m_pWebBrowser = std::make_unique&lt;CWebBrowser&gt;();\n\n   if (m_pWebBrowser != nullptr)\n   {\n      CRect rectClient;\n      GetClientRect(rectClient);\n\n      m_pWebBrowser-&gt;CreateAsync(\n         WS_VISIBLE | WS_CHILD,\n         rectClient,\n         this,\n         1,\n         [this]() {\n            m_pWebBrowser-&gt;SetParentView(this);\n            m_pWebBrowser-&gt;DisablePopups();\n            m_pWebBrowser-&gt;Navigate(L\"https:\/\/bing.com\", nullptr);\n\n            m_pWebBrowser-&gt;RegisterCallback(CWebBrowser::CallbackType::TitleChanged, [this]() {\n               CString title = m_pWebBrowser-&gt;GetTitle();\n\n               if (GetDocument() != nullptr)\n               {\n                  GetDocument()-&gt;SetTitle(title);\n               }\n\n               AfxGetMainWnd()-&gt;SetWindowText(title);\n            });\n         });\n   }\n}<\/pre>\n<h2>List of events<\/h2>\n<p>Currently, the following events can be handled.<\/p>\n<table>\n<tbody>\n<tr valign=\"top\">\n<th>Event<\/th>\n<th>Description<\/th>\n<th>Add\/Remove handlers<\/th>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>AcceleratorKeyPressed<\/tt><\/td>\n<td>Fires when an accelerator key or key combo is pressed or released while the WebView is focused<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2controller#add_acceleratorkeypressed\" target=\"_blank\" rel=\"noopener noreferrer\">add_AcceleratorKeyPressed<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2controller#remove_acceleratorkeypressed\" target=\"_blank\" rel=\"noopener noreferrer\">remove_AcceleratorKeyPressed<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>ContainsFullScreenElementChanged<\/tt><\/td>\n<td>An HTML element inside the WebView is entering fullscreen to the size of the WebView or leaving fullscreen<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_containsfullscreenelementchanged\" target=\"_blank\" rel=\"noopener noreferrer\">add_ContainsFullScreenElementChanged<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_containsfullscreenelementchanged\" target=\"_blank\" rel=\"noopener noreferrer\">remove_ContainsFullScreenElementChanged<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>ContentLoading<\/tt><\/td>\n<td>Fires before any content is loaded, including scripts added with AddScriptToExecuteOnDocumentCreated<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_contentloading\" target=\"_blank\" rel=\"noopener noreferrer\">add_ContentLoading<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_contentloading\" target=\"_blank\" rel=\"noopener noreferrer\">remove_ContentLoading<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>DocumentTitleChanged<\/tt><\/td>\n<td>Fires when the DocumentTitle property of the WebView changes.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_documenttitlechanged\" target=\"_blank\" rel=\"noopener noreferrer\">add_DocumentTitleChanged<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_documenttitlechanged\" target=\"_blank\" rel=\"noopener noreferrer\">remove_DocumentTitleChanged<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>FrameNavigationCompleted<\/tt><\/td>\n<td>Fires when a child frame has completely loaded (body.onload has fired) or loading stopped with error.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_framenavigationcompleted\" target=\"_blank\" rel=\"noopener noreferrer\">add_FrameNavigationCompleted<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_framenavigationcompleted\" target=\"_blank\" rel=\"noopener noreferrer\">remove_FrameNavigationCompleted<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>FrameNavigationStarting<\/tt><\/td>\n<td>Fires when a child frame in the WebView requesting permission to navigate to a different URI.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_framenavigationstarting\" target=\"_blank\" rel=\"noopener noreferrer\">add_FrameNavigationStarting<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_framenavigationstarting\" target=\"_blank\" rel=\"noopener noreferrer\">remove_FrameNavigationStarting<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>GotFocus<\/tt><\/td>\n<td>Fires when WebView got focus.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2controller#add_gotfocus\" target=\"_blank\" rel=\"noopener noreferrer\">add_GotFocus<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2controller#remove_gotfocus\" target=\"_blank\" rel=\"noopener noreferrer\">remove_GotFocus<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>LostFocus<\/tt><\/td>\n<td>Fires when WebView lost focus.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2controller#add_lostfocus\" target=\"_blank\" rel=\"noopener noreferrer\">add_LostFocus<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2controller#remove_lostfocus\" target=\"_blank\" rel=\"noopener noreferrer\">remove_LostFocus<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>MoveFocusRequested<\/tt><\/td>\n<td>Fires when the user tries to tab out of the WebView.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2controller#add_movefocusrequested\" target=\"_blank\" rel=\"noopener noreferrer\">add_MoveFocusRequested<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2controller#remove_movefocusrequested\" target=\"_blank\" rel=\"noopener noreferrer\">remove_MoveFocusRequested<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>NavigationCompleted<\/tt><\/td>\n<td>Fires when the WebView has completely loaded (body.onload has fired) or loading stopped with error.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_navigationcompleted\" target=\"_blank\" rel=\"noopener noreferrer\">add_NavigationCompleted<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_navigationcompleted\" target=\"_blank\" rel=\"noopener noreferrer\">remove_NavigationCompleted<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>NavigationStarting<\/tt><\/td>\n<td>Fires when the WebView main frame is requesting permission to navigate to a different URI<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_navigationstarting\" target=\"_blank\" rel=\"noopener noreferrer\">add_NavigationStarting<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_navigationstarting\" target=\"_blank\" rel=\"noopener noreferrer\">remove_NavigationStarting<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>NewWindowRequested<\/tt><\/td>\n<td>Fires when content inside the WebView requested to open a new window, such as through window.open.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_newwindowrequested\" target=\"_blank\" rel=\"noopener noreferrer\">add_NewWindowRequested<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_newwindowrequested\" target=\"_blank\" rel=\"noopener noreferrer\">remove_NewWindowRequested<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>PermissionRequested<\/tt><\/td>\n<td>Fires when content in a WebView requests permission to access some privileged resources.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_permissionrequested\" target=\"_blank\" rel=\"noopener noreferrer\">add_PermissionRequested<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_permissionrequested\" target=\"_blank\" rel=\"noopener noreferrer\">remove_PermissionRequested<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>ProcessFailed<\/tt><\/td>\n<td>Fires when a WebView process terminated unexpectedly or become unresponsive.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_processfailed\" target=\"_blank\" rel=\"noopener noreferrer\">add_ProcessFailed<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_processfailed\" target=\"_blank\" rel=\"noopener noreferrer\">remove_ProcessFailed<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>HistoryChange<\/tt><\/td>\n<td>Listen to the change of navigation history for the top level document.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_historychanged\" target=\"_blank\" rel=\"noopener noreferrer\">add_HistoryChanged<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_historychanged\" target=\"_blank\" rel=\"noopener noreferrer\">remove_HistoryChanged<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>ScriptDialogOpening<\/tt><\/td>\n<td>Fires when a JavaScript dialog (alert, confirm, or prompt) will show for the webview.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_scriptdialogopening\" target=\"_blank\" rel=\"noopener noreferrer\">add_ScriptDialogOpening<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_permissionrequested\" target=\"_blank\" rel=\"noopener noreferrer\">remove_ScriptDialogOpening<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>SourceChanged<\/tt><\/td>\n<td>Fires when the Source property changes.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_sourcechanged\" target=\"_blank\" rel=\"noopener noreferrer\">add_SourceChanged<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_sourcechanged\" target=\"_blank\" rel=\"noopener noreferrer\">remove_SourceChanged<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>WebMessageReceived<\/tt><\/td>\n<td>Fires when the IsWebMessageEnabled setting is set and the top level document of the webview calls window.chrome.webview.postMessage.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_webmessagereceived\" target=\"_blank\" rel=\"noopener noreferrer\">add_WebMessageReceived<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_webmessagereceived\" target=\"_blank\" rel=\"noopener noreferrer\">remove_WebMessageReceived<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>WebResourceRequested<\/tt><\/td>\n<td>Fires when the WebView is performing an HTTP request to a matching URL and resource context filter that was added with AddWebResourceRequestedFilter.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_webresourcerequested\" target=\"_blank\" rel=\"noopener noreferrer\">add_WebResourceRequested<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_webresourcerequested\" target=\"_blank\" rel=\"noopener noreferrer\">remove_WebResourceRequested<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>WindowCloseRequested<\/tt><\/td>\n<td>Fires when content inside the WebView requested to close the window, such as after window.close is called.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#add_windowcloserequested\" target=\"_blank\" rel=\"noopener noreferrer\">add_WindowCloseRequested<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2#remove_windowcloserequested\" target=\"_blank\" rel=\"noopener noreferrer\">remove_WindowCloseRequested<\/a><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><tt>ZoomFactorChanged<\/tt><\/td>\n<td>Fires when the ZoomFactor property of the WebView changes, either because the caller modified the ZoomFactor property, or due to the user manually modifying the zoom.<\/td>\n<td><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2controller#add_zoomfactorchanged\" target=\"_blank\" rel=\"noopener noreferrer\">add_ZoomFactorChanged<\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/hosting\/webview2\/reference\/icorewebview2controller#remove_zoomfactorchanged\" target=\"_blank\" rel=\"noopener noreferrer\">remove_ZoomFactorChanged<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Try the app<\/h2>\n<p>You can download, build, and try the sample app for this series from here: <div class=\"wp-block-button\">\n<a  data-e-Disable-Page-Transition=\"true\" class=\"dlm-download-link dlm-download-default wp-block-button__link wp-element-button\" title=\"Version 6\" href=\"https:\/\/mariusbancila.ro\/blog\/download\/3689\/?tmstv=1791236397\" rel=\"nofollow\" id=\"download-link-3689\" data-redirect=\"false\" >\n\tMfcEdgeDemo.zip\t(<span class=\"dlm-download-count-value\">40096 downloads<\/span>\n\t)\n<\/a>\n<\/div>\n.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article has been updated for the version of WebView2 that requires Microsoft Edge WebView2 Runtime 88.0.705.50 or newer. In the previous article, we learned how to create a web view and display web content in a Windows desktop application. In this third article of the series, we will look in detail at navigation and &#8230; <a title=\"Using Microsoft Edge in a native Windows desktop app \u2013 part 3\" class=\"read-more\" href=\"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/\" aria-label=\"Read more about Using Microsoft Edge in a native Windows desktop app \u2013 part 3\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[7,608,10,19,146],"tags":[263,451,616,617,453,55,459],"class_list":["post-3702","post","type-post","status-publish","format-standard","hentry","category-c","category-edge","category-visual-studio","category-web","category-windows","tag-browser","tag-c","tag-edge","tag-html","tag-mfc","tag-visualstudio","tag-windows"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Marius Bancila\"\/>\n\t<meta name=\"keywords\" content=\"c++,edge,browser,windows,mfc,html,visualstudio\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Marius Bancila&#039;s Blog | About code. Mostly on C++\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Using Microsoft Edge in a native Windows desktop app \u2013 part 3\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-01-30T09:43:56+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-04-05T06:06:27+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Using Microsoft Edge in a native Windows desktop app \u2013 part 3\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2020\\\/01\\\/30\\\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\\\/#article\",\"name\":\"Using Microsoft Edge in a native Windows desktop app \\u2013 part 3\",\"headline\":\"Using Microsoft Edge in a native Windows desktop app \\u2013 part 3\",\"author\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/dot_inline_dotgraph_1.png\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2020\\\/01\\\/30\\\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\\\/#articleImage\",\"width\":526,\"height\":583},\"datePublished\":\"2020-01-30T11:43:56+02:00\",\"dateModified\":\"2023-04-05T08:06:27+02:00\",\"inLanguage\":\"en-US\",\"commentCount\":6,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2020\\\/01\\\/30\\\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2020\\\/01\\\/30\\\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\\\/#webpage\"},\"articleSection\":\"C++, Edge, Visual Studio, Web, Windows, browser, C++, Edge, HTML, MFC, VisualStudio, Windows\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2020\\\/01\\\/30\\\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"position\":2,\"name\":\"IT\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"name\":\"Software\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"position\":3,\"name\":\"Software\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"name\":\"C++\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"position\":4,\"name\":\"C++\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2020\\\/01\\\/30\\\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\\\/#listItem\",\"name\":\"Using Microsoft Edge in a native Windows desktop app \\u2013 part 3\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"name\":\"Software\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2020\\\/01\\\/30\\\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\\\/#listItem\",\"position\":5,\"name\":\"Using Microsoft Edge in a native Windows desktop app \\u2013 part 3\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"name\":\"C++\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\",\"name\":\"Marius Bancila's Blog\",\"description\":\"About code. Mostly on C++\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/\",\"name\":\"Marius Bancila\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2020\\\/01\\\/30\\\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a84dd2831d955c38355ddea55df4df260809b88f36408bc14fd4eab8f7f131c9?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Marius Bancila\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2020\\\/01\\\/30\\\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\\\/#webpage\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2020\\\/01\\\/30\\\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\\\/\",\"name\":\"Using Microsoft Edge in a native Windows desktop app \\u2013 part 3\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2020\\\/01\\\/30\\\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2020-01-30T11:43:56+02:00\",\"dateModified\":\"2023-04-05T08:06:27+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\",\"name\":\"Marius Bancila's Blog\",\"description\":\"About code. Mostly on C++\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Using Microsoft Edge in a native Windows desktop app \u2013 part 3","description":"","canonical_url":"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/","robots":"max-image-preview:large","keywords":"c++,edge,browser,windows,mfc,html,visualstudio","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/#article","name":"Using Microsoft Edge in a native Windows desktop app \u2013 part 3","headline":"Using Microsoft Edge in a native Windows desktop app \u2013 part 3","author":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/mariusbancila.ro\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/mariusbancila.ro\/blog\/wp-content\/uploads\/2020\/01\/dot_inline_dotgraph_1.png","@id":"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/#articleImage","width":526,"height":583},"datePublished":"2020-01-30T11:43:56+02:00","dateModified":"2023-04-05T08:06:27+02:00","inLanguage":"en-US","commentCount":6,"mainEntityOfPage":{"@id":"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/#webpage"},"isPartOf":{"@id":"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/#webpage"},"articleSection":"C++, Edge, Visual Studio, Web, Windows, browser, C++, Edge, HTML, MFC, VisualStudio, Windows"},{"@type":"BreadcrumbList","@id":"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog#listItem","position":1,"name":"Home","item":"https:\/\/mariusbancila.ro\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","position":2,"name":"IT","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","name":"Software"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","position":3,"name":"Software","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","name":"C++"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","position":4,"name":"C++","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/#listItem","name":"Using Microsoft Edge in a native Windows desktop app \u2013 part 3"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","name":"Software"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/#listItem","position":5,"name":"Using Microsoft Edge in a native Windows desktop app \u2013 part 3","previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","name":"C++"}}]},{"@type":"Organization","@id":"https:\/\/mariusbancila.ro\/blog\/#organization","name":"Marius Bancila's Blog","description":"About code. Mostly on C++","url":"https:\/\/mariusbancila.ro\/blog\/"},{"@type":"Person","@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author","url":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/","name":"Marius Bancila","image":{"@type":"ImageObject","@id":"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/a84dd2831d955c38355ddea55df4df260809b88f36408bc14fd4eab8f7f131c9?s=96&d=mm&r=g","width":96,"height":96,"caption":"Marius Bancila"}},{"@type":"WebPage","@id":"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/#webpage","url":"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/","name":"Using Microsoft Edge in a native Windows desktop app \u2013 part 3","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/mariusbancila.ro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/#breadcrumblist"},"author":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"creator":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"datePublished":"2020-01-30T11:43:56+02:00","dateModified":"2023-04-05T08:06:27+02:00"},{"@type":"WebSite","@id":"https:\/\/mariusbancila.ro\/blog\/#website","url":"https:\/\/mariusbancila.ro\/blog\/","name":"Marius Bancila's Blog","description":"About code. Mostly on C++","inLanguage":"en-US","publisher":{"@id":"https:\/\/mariusbancila.ro\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Marius Bancila's Blog | About code. Mostly on C++","og:type":"article","og:title":"Using Microsoft Edge in a native Windows desktop app \u2013 part 3","og:url":"https:\/\/mariusbancila.ro\/blog\/2020\/01\/30\/using-microsoft-edge-in-a-native-windows-desktop-app-part-3\/","article:published_time":"2020-01-30T09:43:56+00:00","article:modified_time":"2023-04-05T06:06:27+00:00","twitter:card":"summary","twitter:title":"Using Microsoft Edge in a native Windows desktop app \u2013 part 3"},"aioseo_meta_data":{"post_id":"3702","title":null,"description":null,"keywords":[{"label":"C++","value":"C++"},{"label":"Edge","value":"Edge"},{"label":"browser","value":"browser"},{"label":"Windows","value":"Windows"},{"label":"MFC","value":"MFC"},{"label":"HTML","value":"HTML"},{"label":"VisualStudio","value":"VisualStudio"}],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-03-18 21:03:35","updated":"2025-12-12 07:54:48","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"author_meta":{"display_name":"Marius Bancila","author_link":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/"},"featured_img":null,"jetpack_publicize_connections":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Marius Bancila","author_link":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/"},"uagb_comment_info":6,"uagb_excerpt":"This article has been updated for the version of WebView2 that requires Microsoft Edge WebView2 Runtime 88.0.705.50 or newer. In the previous article, we learned how to create a web view and display web content in a Windows desktop application. In this third article of the series, we will look in detail at navigation and&hellip;","coauthors":[],"tax_additional":{"categories":{"linked":["<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/\" class=\"advgb-post-tax-term\">C++<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/web\/edge\/\" class=\"advgb-post-tax-term\">Edge<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/visual-studio\/\" class=\"advgb-post-tax-term\">Visual Studio<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/web\/\" class=\"advgb-post-tax-term\">Web<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/windows\/\" class=\"advgb-post-tax-term\">Windows<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">C++<\/span>","<span class=\"advgb-post-tax-term\">Edge<\/span>","<span class=\"advgb-post-tax-term\">Visual Studio<\/span>","<span class=\"advgb-post-tax-term\">Web<\/span>","<span class=\"advgb-post-tax-term\">Windows<\/span>"]},"tags":{"linked":["<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/windows\/\" class=\"advgb-post-tax-term\">browser<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/windows\/\" class=\"advgb-post-tax-term\">C++<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/windows\/\" class=\"advgb-post-tax-term\">Edge<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/windows\/\" class=\"advgb-post-tax-term\">HTML<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/windows\/\" class=\"advgb-post-tax-term\">MFC<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/windows\/\" class=\"advgb-post-tax-term\">VisualStudio<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/windows\/\" class=\"advgb-post-tax-term\">Windows<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">browser<\/span>","<span class=\"advgb-post-tax-term\">C++<\/span>","<span class=\"advgb-post-tax-term\">Edge<\/span>","<span class=\"advgb-post-tax-term\">HTML<\/span>","<span class=\"advgb-post-tax-term\">MFC<\/span>","<span class=\"advgb-post-tax-term\">VisualStudio<\/span>","<span class=\"advgb-post-tax-term\">Windows<\/span>"]}},"comment_count":"6","relative_dates":{"created":"Posted 7 years ago","modified":"Updated 4 years ago"},"absolute_dates":{"created":"Posted on January 30, 2020","modified":"Updated on April 5, 2023"},"absolute_dates_time":{"created":"Posted on January 30, 2020 11:43 am","modified":"Updated on April 5, 2023 8:06 am"},"featured_img_caption":"","series_order":"","jetpack_shortlink":"https:\/\/wp.me\/pYNdv-XI","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/3702","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/comments?post=3702"}],"version-history":[{"count":15,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/3702\/revisions"}],"predecessor-version":[{"id":4648,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/3702\/revisions\/4648"}],"wp:attachment":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/media?parent=3702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/categories?post=3702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/tags?post=3702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}