MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: window.chrome.webview.postMessage stops working on youtube.com

Open
#5,239 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What happened?

window.chrome.webview.postMessage stops working when visiting pages on youtube.com. It accepts messages, but these messages never arrive on the native side, i.e., WebMessageReceived event. It works on any other site, e.g., wikipedia.org.

This seems to be caused by something that youtube.com has changed on their side, as it used to work with the same runtime version.

See our investigation results in my comment.

Importance

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

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

135.0.3179.73

SDK Version

1.0.3116

Framework

WPF

Operating System

Windows 11

OS Version

26100.3775

Repro steps

Please use my WebView2Samples fork with the code to reproduce the issue.

  • Change BrowserExecutableFolder = "[path to WebView2 135.0.3179.73 runtime]" line in MainWindow.InitializeWebView() to point to the WebView2 135.0.3179.73 runtime directory.
  • Start the browser from the IDE and open the debug output window to see the Debug.WriteLine output.
  • Visit https://www.wikipedia.org/ and observe WebMessageReceived: {"Initial":true} followed by WebMessageReceived: {"Ping":true} every second.
  • Visit https://www.youtube.com/watch?v=vBCrJaLseQc and observe only a single WebMessageReceived: {"Initial":true} message. Ping messages are not coming through. You can check the browser console to see that ping messages are still being sent from the JS side.
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

Start with the linked WebView2Samples fork and the BrowserExecutableFolder line in MainWindow.InitializeWebView(). Reproduce the message flow on wikipedia.org and youtube.com, then compare the Debug.WriteLine output with the browser console to isolate the WebView2 or page-side change; done means identifying a confirmed cause and documented fix path.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, javascript
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.