1

is it possible to get the result of a call to

LWebView.evaluateJavascript(StringToJString('test'), fJavaScriptValueCallback);

instantly? My problem is that the event of the fJavaScriptValueCallback is called after my following code.

In VCL Delphi i would write an Application.ProcessMessages, till i got the answer from the WebBrowser, but this didn't work in FMX/Android.

Is there an other way to force the result or to get the values of the HTML Elements?

3
  • 1
    The standard practice is to have the following code in the callback. For an example, see en.delphipraxis.net/topic/… Commented Feb 12, 2024 at 16:33
  • Yes i know the standard practice - and this works most times. But in one condition i need to know the result immediately (getting the val() of an input element) Therefor i asked if it is possible to wait (TThread.sleep(10) till the TWebBrowser prcoessed the eval, and i got the result) Commented Feb 12, 2024 at 17:26
  • 3
    Sorry, but evaluateJavascript() runs asynchronously, you have to deal with the callback, that is simply how it works. You will just have to move your "following code" into the callback (or otherwise have the callback trigger the code). A lot of things in Android run asynchronously. Commented Feb 12, 2024 at 17:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.