I
I
Igor Prishchepa2015-12-29 20:01:42
.NET
Igor Prishchepa, 2015-12-29 20:01:42

WebView, C#, Windows. How to find out the download is complete and get the final address?

There is a Windows Phone project on it there is a WebView component. By pressing the button, it jumps to a specific resource. There is a need to find out that:
1) The download is complete, that is, all redirects, etc. have ended.
2) Get the end address.
Tried to take after the end (just at the very end) from WebView.Source but the one that was specified for Navigate is stored there.
I tried to google, but apparently I need to poke my nose, I couldn’t find it myself.
For example: vk.cc/snBwO in WebView loaded as it should be google but in Source vk.cc/snBwO , and I would like to see https://google.com

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melz, 2015-12-30
@melz

LoadCompleted seems to have been removed, subscribe to NavigationCompleted. It?

private void webView1_NavigationCompleted(WebView sender, WebViewNavigationCompletedEventArgs args)
{
    if (args.IsSuccess == true)
    {
        statusTextBlock.Text = "Navigation to " + args.Uri.ToString() + " completed successfully.";
    }
    else
    {
        statusTextBlock.Text = "Navigation to: " + args.Uri.ToString() + 
                               " failed with error " + args.WebErrorStatus.ToString();
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question