Welcome Guest Search | Active Topics | Sign In | Register

Interacting with DOM Elements Options
hepsubah
Posted: Monday, February 28, 2022 6:50:27 PM
Rank: Newbie
Groups: Member

Joined: 2/28/2022
Posts: 1
Does the product have the ability to 'click', 'hover', on DOM Elements?
Code: C#
eo_support
Posted: Monday, February 28, 2022 8:47:19 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

You will need to do it with JavaScript. You can then call into C# side with JavaScript extension. The code can be something like this:

Code: C#
webView.EvalScript(@"
document.body.addEventListener('click', function()
{{
	eoapi.extInvoke('test');
}}, true);");


Here it runs a piece of JavaScript code to attach click event handler. Inside the click event handler it calls eoapi.extInvoke. This will call into .NET side and trigger the WebView's JSExtInvoke event. Obviously you would need to replace the arguments you pass to extInvoke with something that's more useful for you. See here for more details on how to use eoapi.extInvoke:

https://www.essentialobjects.com/doc/webbrowser/advanced/jsext

Please feel free to let us know if you have any more questions.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.