MicrosoftEdge / MicrosoftEdge/WebView2Feedback
executeScript not returning JSON
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
executeScript rarely returns JSON e.g.
WebView2.executeScript("document.activeElement.getBoundingClientRect()")
Returns null
I'm having to wrap the result in JSON.
WebView2.executeScript("JSON.stringify(document.activeElement.getBoundingClientRect())")
Returns correct JSON but escaped (as expected).
"{\"x\":296,\"y\":322.5,\"width\":427,\"height\":34,\"top\":322.5,\"right\":723,\"bottom\":356.5,\"left\":296}"
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 by reproducing the issue through WebView2.executeScript with document.activeElement.getBoundingClientRect(), then compare it with the JSON.stringify variant shown in the report. Check the executeScript result-handling entry point and determine whether the returned value can preserve the object; done means the reported expression returns usable JSON without requiring the caller to wrap it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100