Replies: 2 comments
-
@vbryh-msft is this something that is currently possible? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm not aware of any official ways of doing this and search engines are saying that it is expected for event handlers - can you accumulate number of calls to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have created a small app to test some javascript code directly on the webview2 https://github.com/themhz/WebView2JsDebugger .
anyway when I write some code say for example console.log("test"); and add the script to the webview2 and attach the event
webView21.WebMessageReceived += WebView_WebMessageReceived;
nothing happens.
if then I run something like that:
the event WebView_WebMessageReceived is added second time and then its fired twice. One for the previous execution event that was attached and one for the current.
In general If I run some random js code say console.log("test"); and attach the event 3 times then if I run on time
var data = { 'taskStatus': 'success', 'message': 'some data' };
window.chrome.webview.postMessage(JSON.stringify(data)); and attach the WebView_WebMessageReceived the fourth time then I get the message back 4 times. So it seems that this is being added to a que in the webview. I do remove the event by the following code when I receive the message:
So the question: is there a way to know how many events were attached to the webview2 from with
webView21.WebMessageReceived += WebView_WebMessageReceived; ??
This is the upload button code
Beta Was this translation helpful? Give feedback.
All reactions