-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CoreWebView2NavigationCompletedEventArgs does not include a Uri
property. Why?
#580
Comments
At that point, uri is available from |
Thanks @ukandrewc . But do you mean
|
Sorry yes, Url is an extension of mine ;-) |
Thanks @ukandrewc I guess I'm still calling this a bug/design issue. |
I've added this to our backlog, thanks! |
A fortiori, CEFSharp's frame navigation complete event gives the Uri of the frame. It's possible to get the Uri from WebView2's frame navigation started event, stash it in a Dictionary, then look it up on frame navigation completed. But it would have been super nice to not have to do that. Especially because it looks like the frame navigation completion event can fire while the debugger's stopped on a breakpoint in frame navigation started. |
@champnic |
This is currently a Priority 3 on our backlog, so I can't give an accurate timeline, but probably not for a while. Sorry. |
This one definitely needs to be in at least P2 if not P1. As more and more people migrate out of WebBrowser the need for URI in NavigationCompleted event will be felt. |
@santra-a I'll let the owning team know. Does the workaround of checking the "Source" property work for you in the meantime? |
Having an Foremost since your above workaround can not always be applied, cause of this WebView2 issue i had to handle with. I had a hard time with all that stuff and my life would have been a million times easier if i had an |
@novac42 @santra-a I'm using microsoft one drive sdk and trying to port it to winui 3.0 and webview2.0. As you can see there was an url property in args and it was used. And now it disappeared. How come that you deleted it? Why do you waste so many years in chats instead of simply fixing design bug?https://github.com/OneDrive/onedrive-sdk-dotnet-msa-auth-adapter/blob/master/src/OneDrive.Sdk.Authentication.UWP/Web/IotFriendlyWebDialog.xaml.cs |
@champnic I need this as well but also for iframes. And the [CoreWebView2Frame[(https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2frame?view=webview2-dotnet-1.0.2420.47) class doesn't contain any type of |
Yep, that‘s exactly the same, what i did. A developer’s only chance is to link the navigation IDs with the starting URLs. Since the IDs are your only single point of truth. Would still keep this issue open, since it‘s wether a great solution (to a relatively simple problem, for the WebView2 devs, imo), nor do i like to bring such form of „state“ (i.e. some dict with IDs and URLs) into play. Also this workaround becomes very „funny“ when dealing with redirects. 😜 |
The
CoreWebView2NavigationCompletedEventArgs
event does not include aUri
property. This is the event received when subscribing to theWebView2
NavigationCompleted
event. This is rather inconvenient and does not align with theCoreWebView2NavigationStartingEventArgs
event which does include aUri
property.Is this "by design"? Because it feels just like an omission.
Our we now supposed to use a dictionary of
NavigationId
s to figure out theUri
based on remembering theUri
we get in theNavigationStarting
event?package id="Microsoft.Web.WebView2"
version="1.0.674-prerelease"
targetFramework="net48"
AB#30069393
The text was updated successfully, but these errors were encountered: