MicrosoftEdge / MicrosoftEdge/WebView2Feedback

--enable-features=msWebView2BrowserHitTransparent Causes the program to crash in

Open
#4,512 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

What happened?

.Net8 WinForm

Using Form.Close() code in WebView2's KeyDown event crashes the program when using --enable-features=msWebView2BrowserHitTransparent.

private void webView21_KeyDown(object sender, KeyEventArgs e)
{
    this.Close();
}

private async void Form1_Load(object sender, EventArgs e)
{
    var options = new CoreWebView2EnvironmentOptions
    {
        AdditionalBrowserArguments = "--enable-features=msWebView2BrowserHitTransparent"
    };
    var env = await CoreWebView2Environment.CreateAsync(null, null, options);

    await webView21.EnsureCoreWebView2Async(env);

    webView21.Source = new Uri("https://www.google.com");
}
Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

124.0.2478.67

SDK Version

1.0.2478.35

Framework

Winforms

Operating System

Windows 10

OS Version

19045.4355

Repro steps
  1. Create WinForm Application
  2. Add WebView2 Control
  3. Add My post code
  4. Run App
  5. Press ESC Key
  6. Application Crash
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.

Research direction

Reproduce the crash in a .NET 8 WinForms application using the WebView2 control, runtime 124.0.2478.67, and the provided CoreWebView2EnvironmentOptions setup. Press ESC to trigger Form.Close() from the KeyDown handler, then compare behavior with and without msWebView2BrowserHitTransparent; done means the application no longer crashes under the reported configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.