MicrosoftEdge / MicrosoftEdge/WebView2Feedback

executeScript not returning JSON

Open
#76 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug priority-low tracked
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}"

AB#28556110

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.