Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

How to detect mouse click in TChromiumWindow?

Post Reply
User avatar
АндрейФа
Posts: 1
Joined: Thu Mar 05, 2020 12:03 pm

How to detect mouse click in TChromiumWindow?

Post 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.
User avatar
salvadordf
Posts: 4052
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to detect mouse click in TChromiumWindow?

Post 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.
Post Reply