MicrosoftEdge / MicrosoftEdge/WebView2Feedback
CoreWebView2WebResourceResponseReceivedEventArgs and CoreWebView2WebResourceRequestedEventArgs null Content
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
c#/WPF
When using WebView.CoreWebView2.WebResourceRequested or WebResourceResponseReceived
agrs.Request.Content.
or
agrs.Response.Content
Always return null. According to documentation, e.g. https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2webresourceresponse.content?view=webview2-dotnet-1.0.1462.37#microsoft-web-webview2-core-corewebview2webresourceresponse-content
I can do get and set. Set happens fine and is handled, but get is not possible because the stream is always empty.
The headers are always passed.
When used:
CoreWebView2WebResourceResponseReceivedEventArgs
And there is a POST request, then Request.Content is filled in perfectly.
If you open the other documentation:
https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/webresourcerequested?tabs=dotnet
Section: Example: Overriding a response, to proactively replace it
Great example, but the task is to take args.Response and replace <html with <HTML, for example. But this can't be done because args.Response=null
Maybe I don't understand the logic of these methods correctly.
Version
SDK: 1.0.1462.37
Runtime: 1.0.1462.37
Framework: WPF
OS: Windows 10
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.
Research direction
Start with the WebResourceRequested and WebResourceResponseReceived event paths and compare Request.Content and Response.Content against the linked WebView2 documentation for SDK/runtime 1.0.1462.37. Reproduce the WPF POST and response-replacement cases; done means establishing whether the null or empty streams are expected or a confirmed defect, with the affected API behavior documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100