Skip to content

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

Open
@seldoff

Description

@seldoff

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtrackedWe are tracking this work internally.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions