window.chrome.webview.postmessage from child html to main c++ app (webView2)
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I am using WebView2 for displaying html contents in my win32 application. I have parent.html in which I am providing reference of child.html like -
In child.html :
clickhere
function postmessagetocode() {
window.chrome.webview.postmessage('clickSample');
}In my c++ code I am loading parent.htm and want to get above message 'clickSample' in
m_webView->add_WebMessageReceived
. Issue that I am facing : by doing like above I am not getting this message in code. If I post any message from parent.html then I can get it. But if I do like from child.html then it never come to c++ code. Is there the way to do so? Is it something like I need to catch the message at parent.html first then post again to c++? Thanks.