title: Delphi Chromium Embedded - How can i return a value from JS function into Delphi
body: <p>I can successfully raise an event from JS into my delphi application using the technique described in this link:</p>
  
  <p><a href="https://stackoverflow.com/questions/24647762/dcef3-delphi-chromium-embedded-communication-between-javascript-and-applicat/27186471#27186471">Delphi Chromium Embedded - communication between Javascript and application code</a></p>
  
  <p>Now I want to return a value from a function that called in JS.</p>
  
  <p>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.</p>
  
  <p>I try to use a sleep(100) function after ExecuteJavaScript and this works well but it is not a very nice solution.</p>
  
  <p>Is there any way to have returns from functions, without using events?</p>