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
What happened?
NavigationCompletedevent handler reports navigation failed when clicking on a file download link, while theHttpStatusCodeis 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
Navigate to the download page, like
https://developer.microsoft.com/en-us/microsoft-edge/webview2download 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