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 can I click a button using it x, y position?

Post Reply
User avatar
salvadordf
Posts: 4042
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How can I click a button using it x, y position?

Post by salvadordf »

To send information from JavaScript to Delphi you can use JavaScript extensions.

JavaScript extensions are custom functions that you can call from JavaScript code but those functions execute Delphi code.

Remember that JavaScript is executed in the render process so you will need to send a process message with your coordinates from the Delphi code in your extension to the main browser process.

The JSRTTIExtension and JSExtension demos have all the code you need.

To test them follow these steps :
  • Run the demo and wait until google.com is loaded
  • Right-click and select the "Set the mouseover event" menu option.
  • Move the mouse pointer over the web page and see the HTML elements in the status bar.
Read the code comments in those demos for more details.
Post Reply