MicrosoftEdge / MicrosoftEdge/WebView2Feedback
Contents returned by document.body.innerText for raw JSON have changed
@david-risney is already working on this.
Since Jun 13, 2023.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Description
The handling of raw content (application/json and application/hal+json) has changed, which breaks our existing integration for situations where endpoints return raw content instead on HTML.
Version
SDK: 1.0.1823.32
Runtime: Edge Canary, 116.0.0.0
Framework: Win32
OS: Win10, Win11
Repro Steps
- Load JSON content into browser [https://jsonplaceholder.typicode.com/posts/1](https://jsonplaceholder.typicode.com/posts/1)
- Open DevTool Console
- Execute:
document.body.innerText
WebView2 Runtime 114.* and earlier:
Raw JSON
Webview2/Edge Canary 116.*:
Some mangled version of the content.
Additional context
Note that response.body.textContent still return the original JSON, but also include trailing mangled content.
Also note that script injection workarounds fail since fetch is not allowed:
Possible workaround
Initial experimenting indicate this snippet as a possible workaround document.body.innerText.substr(document.body.innerText.indexOf('{')).
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.