Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Problem/Bug]: Browser process crashes in context menu with custom menu items #4615

Open
seldoff opened this issue Jun 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@seldoff
Copy link

seldoff commented Jun 5, 2024

What happened?

  • An item with an icon is added to the browser context menu when the context menu is triggered for the first time.
  • A different item with an icon is added to the browser context menu when the context menu is triggered for the second time.
  • Context menu is triggered for a misspelled word.
  • Several blank items are displayed instead of the spelling suggestions.
  • When the last blank item is clicked, the browser process crashes.

The crash does not occur and no blank spelling suggestions are displayed if no icons are supplied for the custom menu items.

Failed workarounds

  • Crash occurs with icons loaded from assembly resources or files.
  • Crash occurs with icons copied to a dedicated per-item MemoryStream.

See https://github.com/seldoff/WebView2Samples/tree/menu-crash/SampleApps/WebView2WpfBrowser project for a repro code. The code that adds offending menu items is in the MainWindow.WebView_ContextMenuRequested method.

Importance

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

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

125.0.2535.85

SDK Version

1.0.2535.41

Framework

WPF

Operating System

Windows 10, Windows 11

OS Version

22631.3593

Repro steps

Use the WebView2WpfBrowser sample project from https://github.com/seldoff/WebView2Samples/blob/menu-crash/SampleApps/WebView2WpfBrowser.

  1. Start the app, it navigates to https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_textarea.
  2. Replace text in the text box in the right panel with a misspelled word: "tesst".
  3. Right-click on the misspelled word. The context menu with a spelling suggestion is displayed.
  4. Right-click on the misspelled word again. The context menu with three empty suggestions is displayed.

5. Click on the third empty suggestion. The browser process crashes.

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

@seldoff seldoff added the bug Something isn't working label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants