MicrosoftEdge / MicrosoftEdge/WebView2Feedback
[Feature]: Expose an event for failed web requests to the host application
@Lakshmisha-KS is already working on this.
Since May 27, 2026.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Describe the feature/enhancement you need
Mainly for diagnostic purposes, it would be helpful to expose an event to the host application when a web request fails due to a network error. If I'm understanding the Chromium code correctly, I think this is typically done by setting an OnRequestError override in the implementation's ProxyingURLLoaderFactory::InProgressRequest class (this seems to be what Electron does for its webRequest.onErrorOccurred event, for example). Then when something unexpectedly goes wrong at the network layer we can easily log it.
I checked and am not seeing a CoreWebView2.WebResourceResponseReceived or a CoreWebView2.NavigationCompleted event raised when the system is preparing to hibernate and a web request is sent out and fails, so I don't think there's a way to get this from the existing WebView2 APIs.
The scenario/use case where you would use this feature
System is suspending and cuts network access, DNS problems, the request is aborted somehow, etc.
How important is this request to you?
Nice to have. There are other ways to tackle this, but having official API support would be beneficial.
Suggested implementation
How about a CoreWebView2.WebResourceRequestFailed event:
public event EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2WebResourceRequestFailedEventArgs> WebResourceRequestFailed;
Where a new CoreWebView2WebResourceRequestFailedEventArgs class contains properties for:
Request- the original CoreWebView2WebResourceRequest from the WebResourceRequested event
ResourceContext- the CoreWebView2WebResourceContext for the web request
WebErrorStatus- the CoreWebView2WebErrorStatus error code
Or instead of reusing the NavigationCompleted event's CoreWebView2WebErrorStatus enum, just expose the error name as a string in the way other CEF implementations do.
What does your app do? Is there a pending deadline for this request?
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.