You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I paste WebView2 into a form and request Navigate, in order to trace all the interaction with the other host, I use WebResourceResponseReceived to get the data received in await, but Await e.Response. GetContentAsync() may raise an exception. Is there any way to deal with this?
The operating environment is as follows (developed in VB.NET)
Windows10
NET Framework 4.8
WebView2 Runtime 126.0.2592.87
Microsoft.Web.WebView2 1.0.2592.61
`
Private Async Sub WebResourceResponseReceived(sender As Object, e As CoreWebView2WebResourceResponseReceivedEventArgs)
Dim objUri As Uri
Dim strContentType As String
Try
If e.Response.StatusCode >= 300 And e.Response.StatusCode <= 399 Then Exit Sub
strContentType = Nothing
For Each objHeader In e.Response.Headers
If objHeader.Key.Equals("Content-Type", StringComparison.OrdinalIgnoreCase) Then
strContentType = objHeader.Value
Exit For
End If
Next
Try
objUri = New Uri(e.Request.Uri)
If objUri.Scheme <> "https" Then Exit Sub
Catch ex As Exception
Exit Sub
End Try
If strContentType IsNot Nothing Then
If Regex.IsMatch(strContentType, "(application/json|text/html|text/xml|text/plan)", RegexOptions.IgnoreCase) Then
Using objStream = Await e.Response.GetContentAsync()
Using objReader As New StreamReader(objStream)
Await objReader.ReadToEndAsync()
End Using
End Using
End If
End If
Catch ex As Exception
Debug.Print("●" & e.Request.Uri)
Debug.Print(e.Response.StatusCode)
Debug.Print("■" & ex.Message)
End Try
End Sub
`
The error that occurs is as follows
Exception thrown: 'System.Runtime.InteropServices.COMException' (in mscorlib.dll)
Importance
Blocking. My app's basic functions are not working due to this issue.
What happened?
When I paste WebView2 into a form and request Navigate, in order to trace all the interaction with the other host, I use WebResourceResponseReceived to get the data received in await, but Await e.Response. GetContentAsync() may raise an exception. Is there any way to deal with this?
The operating environment is as follows (developed in VB.NET)
Windows10
NET Framework 4.8
WebView2 Runtime 126.0.2592.87
Microsoft.Web.WebView2 1.0.2592.61
`
Private Async Sub WebResourceResponseReceived(sender As Object, e As CoreWebView2WebResourceResponseReceivedEventArgs)
`
The error that occurs is as follows
Exception thrown: 'System.Runtime.InteropServices.COMException' (in mscorlib.dll)
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
126.0.2592.87
SDK Version
No response
Framework
Winforms
Operating System
Windows 10
OS Version
No response
Repro steps
The following processes occur with high frequency (not always)
WebView21.CoreWebView2.Navigate("https://ja.aliexpress.com/item/1005005239744204.html")
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
The text was updated successfully, but these errors were encountered: