'Control HTML/JS application with window.postMessage in C# component

Assume I have an HTML/JS component that is rendered inside the WebBrowser C# component (or another browser C# component). This component can be controlled by the window.postMessage() calls, exactly like the parent HTML page can control it in the iframe.

The question is: may I send postMessage's messages to the HTML/JS component from the C# program somehow?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source