Delphi Chromium Embedded - How can i return a value from JS function into Delphi

I can successfully raise an event from JS into my delphi application using the technique described in this link:

Delphi Chromium Embedded - communication between Javascript and application code

Now I want to return a value from a function that called in JS.

I test this case: I raise an event in the function that assign a variable in delphi. This method is asynchronous, which means when I call ExecuteJavaScript, the function immediately returns (unblocking) and before the variable is assigned with JS, I reach the variable that is not assigned.

I try to use a sleep(100) function after ExecuteJavaScript and this works well but it is not a very nice solution.

Is there any way to have returns from functions, without using events?

Answers:

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.