MicrosoftEdge / MicrosoftEdge/WebView2Feedback
Can't view/debug script when using NavigateToString
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
I am unable to view or debug the webview script when the script is set via NavigateToString

To reproduce:
- Start with the win32 WebView2GettingStarted solution
- Instead of
Navigate('bing.com')useNavigateToString()and load some HTML with javascriptwebviewWindow->NavigateToString(LR"( <html><head> <script> window.addEventListener('DOMContentLoaded', ()=>{ document.body.querySelector('div').textContent = 'Goodbye'; }; </script> </head> <body> <div>Hello</div> <div>World</div> </body> </html>)"); - Run the app and open the developer
- There is no script available on the
Sourcestab
Versions
Visual Studio: 16.8.6
MSVC v142
WebView2 1.0.705.50 via nuget
Win32
Win10 18363
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 Win32 WebView2GettingStarted solution and reproduce the issue by replacing Navigate('bing.com') with NavigateToString() using the HTML and JavaScript shown. Inspect the developer tools Sources tab and compare the behavior with a normal navigation. Done means the inline script loaded through NavigateToString is visible and debuggable there.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, javascript
- Domain
- desktop, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100