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]: NavigationCompleted report fail when download a file #5172

Open
HO-COOH opened this issue Mar 19, 2025 · 0 comments
Open

[Problem/Bug]: NavigationCompleted report fail when download a file #5172

HO-COOH opened this issue Mar 19, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@HO-COOH
Copy link

HO-COOH commented Mar 19, 2025

What happened?

NavigationCompleted event handler reports navigation failed when clicking on a file download link, while the HttpStatusCode is 0. This behavior is not documented anywhere.

This is a blocking issue, as I cannot differentiate whether the navigation is failed due to network error (I tried disconnect ethernet, it will be the same status code) or a file download.

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

No response

SDK Version

No response

Framework

Win32

Operating System

Windows 11

OS Version

No response

Repro steps

Use the official C++ win32 getting start project,
add this event handler

EventRegistrationToken token;
webview->add_NavigationCompleted(Callback<ICoreWebView2NavigationCompletedEventHandler>(
	[](ICoreWebView2* webview, ICoreWebView2NavigationCompletedEventArgs* args) -> HRESULT {
		BOOL isSuccess = true;
		args->get_IsSuccess(&isSuccess);
		if (!isSuccess)
		{
			MessageBox(NULL, L"Failed", L"", NULL);
		}
		return S_OK;
	}).Get(), &token);

Navigate to the download page, like https://developer.microsoft.com/en-us/microsoft-edge/webview2
download a file, then the message box shows.

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

@HO-COOH HO-COOH added the bug Something isn't working label Mar 19, 2025
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