-
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
Cancel navigation does not work when clicking link with malformed Uri #400
Comments
Thanks for reporting this! I've opened a bug on our side to investigate. |
Awesome, quick question @champnic , I recently updated the description of an older issue I create. Do you check back for those or should I rather have closed the old issue and created it anew? |
I'm currently doing a pass of all older issues to verify we are still tracking everything and closing out old issues but it's not going super fast :P If it's a different bug please open a new issue. Otherwise, can you link the issue and I can take a look? |
I can see that you found it, awesome. For good measure I also added an example to #398 ;) Thanks for having quick feedback ! |
Hi @cbra-caa I am trying to repro your bug and when clicking the button to navigate to the malformed site, the navigation does complete and I am wondering if you are still able to repro the bug? I am using the same nuget package and .net release. |
Hi @maurawinstanley, I can still reproduce the problem, even in the newest 1.0.664.37 stable version. The flow is that when you navigate to the bad link (there is a space in the middle of the address) the URI validation finds the problem and cancels the request. But the problem is that the navigation completes, as the check WebView_NavigationStarting in has cancelled the request, thus I was expecting to stay on the original page, not navigate to the broken page. Start page, where i expect to stay Bad page, where i actually end up (even though the event for it was cancelled). |
I too am experiencing this bug. Even the following dosn't work:
Using Microsoft.Web.WebView2 1.0.674 with WebView2 Runtime 87.0.664.52 on Windows 7 |
A partial work around is to call WebView2.Stop() |
@fsuk: Your issue should be solved by upgrading to latest prerelease version which fixes your specific issue. But that might be different to the issue this topic is about. |
@Symbai i am already using the latest (non-deprecated) prerelease nuget for WPF (1.0.674) |
I said prerelease version and the latest is |
1.0.707-prerelease has been marked as deprecated. |
This is fixed in 1.0.781-prerelease SDK package, thanks! |
Setup
Problem
The user sees a links and clicks it. Sadly the link leads to nowhere due to, for example, a space placed in the middle of the link. At the moment I catch this errors and then cancel the navigation event but the navigation still completes and shows the dead page to the user.
Code
I have created a minimum viable example which can reproduce the issue. Create a new WPF app with the following code:
MainWindow.xaml
MainWindow.xaml.cs
How to reproduce
Cancel works as expected for our scenarios.
AB#28631879
The text was updated successfully, but these errors were encountered: