Hi,
I tried to have some TButtons execute JavaScript with crm.ExecuteJavaScript(...).
However, since a recent update, it seems that CEFWindowParent1 must have the focus for ExecuteJavaScript to work.
If I click on the CEF control and then a TButton, ExecuteJavaScript works as expected.
If I directly click on a TButton when the form is loaded for instance, ExecuteJavaScript fails. Same if TButton keeps the focus after having been clicked.
Is there a workaround ?
Thanks!
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.
ExecuteJavaScript requires focus
Re: ExecuteJavaScript requires focus
Have you tried it? Chromium.SetFocus(True);
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: ExecuteJavaScript requires focus
Hi,
Try using a TSpeedButton, waiting until the page is fully loaded and setting the focus to the browser before executing the JavaScript code.
Try using a TSpeedButton, waiting until the page is fully loaded and setting the focus to the browser before executing the JavaScript code.
Re: ExecuteJavaScript requires focus
Hi,
Yes, I'm setting the focus before calling JavaScript. But'll I try TSpeedButton instead of TButton.
Thanks!
Yes, I'm setting the focus before calling JavaScript. But'll I try TSpeedButton instead of TButton.
Thanks!