Skip to content

Commit

Permalink
Invoked the SyncPlatformCookiesToVirtualView in OnCoreWebView2Initial…
Browse files Browse the repository at this point in the history
…ized method.
  • Loading branch information
NanthiniMahalingam authored and rmarinho committed Sep 27, 2024
1 parent fbaffb0 commit e767611
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/Core/src/Handlers/WebView/WebViewHandler.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,15 @@ void OnWindowClosed(object sender, WindowEventArgs args)
}
}

void OnCoreWebView2Initialized(WebView2 sender, CoreWebView2InitializedEventArgs args)
async void OnCoreWebView2Initialized(WebView2 sender, CoreWebView2InitializedEventArgs args)
{
sender.CoreWebView2.HistoryChanged += OnHistoryChanged;
sender.CoreWebView2.NavigationStarting += OnNavigationStarting;
sender.CoreWebView2.NavigationCompleted += OnNavigationCompleted;

if (Handler is WebViewHandler handler)
if (Handler is WebViewHandler handler && handler.VirtualView is not null)
{
await handler.SyncPlatformCookiesToVirtualView(sender.CoreWebView2.Source);
sender.UpdateUserAgent(handler.VirtualView);
}
}
Expand Down

0 comments on commit e767611

Please sign in to comment.