MicrosoftEdge / MicrosoftEdge/WebView2Feedback
[Problem/Bug]: launching DevTools concurrently with ExecuteScript leads to deadlock
@gourabkmsft is already working on this.
Since May 27, 2025.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
What happened?
Describe the bug
When attempting to launch the DevTools window (OpenDevToolsWindow) concurrently with executing a script (ExecuteScript) in a WebView2 Win32 C++ application, the application enters a deadlock state. Neither the DevTools window opens nor the script is executed. This occurs consistently when the two operations are triggered (consecutively, ExecuteScript after OpenDevToolsWindow).
Expected behavior
Both operations should complete successfully: the DevTools window opens, and the script executes without blocking each other.
Actual behavior
The application deadlocks indefinitely. The main UI thread calling waiting for ExecuteScript hangs and so does the webview2 thread calling OpenDevToolsWindow, requiring the application to be terminated forcefully.
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
136.0.3240.92
SDK Version
1.0.1661.34
Framework
Win32
Operating System
Windows 10
OS Version
19045.5608
Repro steps
Steps to reproduce
- Create a WebView2 environment and controller.
- Load a webpage or HTML content into the WebView2 control.
- Trigger
OpenDevToolsWindowand then right after thatExecuteScript. - Observe that neither action completes: the DevTools window appears empty and transparent, and the script is not executed (left hanging waiting the result from the callback).
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
Don't know
Last working version (if regression)
No response
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.