Skip to content
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

[Problem/Bug]: On NavigationStarting cancel the navigation did not work #4262

Closed
dfghj44444 opened this issue Dec 26, 2023 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@dfghj44444
Copy link

What happened?

I register an ICoreWebView2NavigationStartingEventHandler event and can work well, if I put_cancal true, the navigation will cancel. But one scene is weired, while the target site contains an invalid ssl certification, like "https://12306.cn", this navgation cannot be canceld, an will go to this page below.
image

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

120.0.2210.91

SDK Version

1.0.1907.177

Framework

Win32

Operating System

Windows 10, Windows 11

OS Version

Win11 pro 23H2

Repro steps

1.register an ICoreWebView2NavigationStartingEventHandler event
2. add args->put_Cancel(true); in the callback
3. open devtool and type in console : window.location.href="https://12306.cn"
4. will see the error page
image

Repros in Edge Browser

No

Regression

No, this never worked

Last working version (if regression)

always work like this

@dfghj44444 dfghj44444 added the bug Something isn't working label Dec 26, 2023
@monica-ch monica-ch self-assigned this Dec 27, 2023
@monica-ch
Copy link
Contributor

@dfghj44444 For SSL interstitial pages you need you listen to add_servercertificateerrordetected event to cancel the request if the Navigation is not successful and failed with ConnectionAborted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants