MicrosoftEdge / MicrosoftEdge/WebView2Feedback
[Problem/Bug]: web messages aren't posted while the system context menu is up
@vbryh-msft is already working on this.
Since Sep 5, 2024.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
What happened?
I listen for messages posted to the app in my WebMessageReceived handler.
That handler won't fire while the system context menu is up (Alt+Space)
Even after the context menu is dismissed (like via Escape), it seems like I have to click in the webview2 for the messages to start getting processed.
This is causing my app to effectively hang while the context menu is up since the webapp is waiting on some messages to get processed which never happens.
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
128.0.2739.54
SDK Version
1.0.2535.41
Framework
Winforms
Operating System
Windows 11
OS Version
22631.4037
Repro steps
- download the WinForms webview2 sample app from here: https://github.com/MicrosoftEdge/WebView2Samples
- in
BrowserForm::AttachControlEventHandlers, add:control.WebMessageReceived += Control_WebMessageReceived;where the event handler just does aDebug.WriteLine('")or something. - add this to the end of AppStartPage.js:
setTimeout(() => { window.chrome.webview.postMessage("message"); }, 5000); - Start the app
- if you wait 5 seconds, the breakpoint in
WebMessageReceivedwill get hit. - If you start the app and hit Alt+Space. The breakpoint won't get hit.
- If you then press escape to dismiss the context menu, the breakpoint still won't be hit.
- If you then click inside of the webview2 control, the breakpoint gets hit.
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
No, this never worked
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.