Page 1 of 1

How to detect mouse click in TChromiumWindow?

Posted: Thu Mar 05, 2020 12:18 pm
by АндрейФа
Hi all. I have a really simple issue, but i didn't found no one solution for my task(

I just need to detect a mouse click at objects with specify Class or ID on the page (by "getElementByClassName" or "getElementByID" . How i can do that, where i can see the sample of it or any tutorial?? I use CEF4Delphi TChromiumWindows and have no ideas how to get the click at any object on downloaded page.

Re: How to detect mouse click in TChromiumWindow?

Posted: Thu Mar 05, 2020 1:17 pm
by salvadordf
Hi,

Please, read this :
https://www.briskbard.com/index.php?lang=en&pageid=cef

As you can see, Chromium uses several processes and the DOM lives in the "renderer" process.

This means that if your application needs to handle HTML elements then you will need to know how to send information between the renderer and the browser processes.

There are several demos showing how to do that like DOMVisitor demo and most of the demos inside the "JavaScript" directory.

Please, read the code comments in the JSExtension demo because it has detailed information about the JavaScript extensions used to send information from JavaScript to your Delphi code in the browser process.