Welcome Guest Search | Active Topics | Sign In | Register

EO.WebBrowser get the selected html clicked, and disable the navigation Options
gabrielcastillo
Posted: Thursday, May 10, 2018 8:53:15 PM
Rank: Newbie
Groups: Member

Joined: 5/10/2018
Posts: 3
I have a winform with a webBrowser. in this web browser i need to know on wich html element the clicked mouse was realized, and not enable the navigation, by example:
in a form html showed on webBrowser control, the user has click on button "send", How i can know the element that was clicked? and how avoid the action asociated to this element, on the ejemplo i need to block the sent action.

kind regards
eo_support
Posted: Friday, May 11, 2018 11:21:48 AM
Rank: Administration
Groups: Administration

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

You can inject your own JavaScript code into the page and then in your JavaScript code you can cancel the click event. You can search online on how to do this with JavaScript.

Once you have the correct JavaScript code, you can use WebView.EvalScript or set WebView.JSInitCode to run the JavaScript. The difference between these two is EvalScript is executed when your call it. JSInitCode is executed when the page is loaded BEFORE everything else runs.

Thanks!
Ramiro
Posted: Tuesday, January 29, 2019 10:23:20 AM
Rank: Newbie
Groups: Member

Joined: 1/29/2019
Posts: 1
gabrielcastillo wrote:
I have a winform with a webBrowser. in this web browser i need to know on wich html element the clicked mouse was realized, and not enable the navigation, by example:
in a form html showed on webBrowser control, the user has click on button "send", How i can know the element that was clicked? and how avoid the action asociated to this element, on the ejemplo i need to block the sent action.

kind regards


Hi Gabriel, do you have a workaround for this? i have the same problem, i want to know which element in webview was clicked... 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.