Page 1 of 1
getBoundingClientRect() to screen coodinate
Posted: Mon Jan 13, 2025 12:12 pm
by coater
If it is possible to translate a value of element.getBoundingClientRect() in JS to a coodinate in sendmessage() in delphi ? T hank you!
Re: getBoundingClientRect() to screen coodinate
Posted: Tue Jan 14, 2025 3:13 pm
by salvadordf
Read this thread :
https://www.briskbard.com/forum/viewtopic.php?p=9792#p9792
It has information for WebView4Delphi but it shows how to sent the element coordinates.
Use a JS extension to send the coordinates to Delphi :
https://github.com/salvadordf/CEF4Delphi/blob/373a19f8f512974d9c0c15b58fd5a5e009d3c24a/demos/Delphi_VCL/JavaScript/JSExtension/uJSExtension.pas#L85
Re: getBoundingClientRect() to screen coodinate
Posted: Thu Feb 06, 2025 11:37 am
by coater
sorry, I cannot find how to get correct coodinate in that web.
Re: getBoundingClientRect() to screen coodinate
Posted: Sun Feb 09, 2025 4:29 pm
by salvadordf
The JSExtension demo uses a JavaScript extension with two methods : mouseover, sendresulttobrowser.
Copy that code and use "sendresulttobrowser" to send custom information from JavaScript to Delphi.