Search code examples
c#uwpfavicon

Get favicon from webview UWP


I have a question: how do I get the favicon of a page displayed in a webview in C# UWP? I want to store the icon to access it later. Is there any way of doing that?

Thank you.


Solution

  • I solved it. I did the following:

    Uri icoURI = new Uri("https://www.google.com/s2/favicons?domain=" + WebPageView.Source);
    currentTab.IconSource = new Microsoft.UI.Xaml.Controls.BitmapIconSource() { UriSource = icoURI, ShowAsMonochrome = false };