MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: launching DevTools concurrently with ExecuteScript leads to deadlock

Open
#5,255 1 comment 0 reactions 1 assignee View on GitHub

@gourabkmsft is already working on this.

Since May 27, 2025.

bug
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

  1. Create a WebView2 environment and controller.
  2. Load a webpage or HTML content into the WebView2 control.
  3. Trigger OpenDevToolsWindow and then right after that ExecuteScript.
  4. 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

  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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.