I was wondering - when calling the org.eclipse.swt.browser.Browser method execute,
- How is the
return booleandetermined? - When is the
javaScriptexecution considered "successful"? - In particular, what happens when I start some asynchronous function and wait for the response?
- Will the browser wait for the callback?
- Is success based on an empty call stack and no errors?
Thanks in advance!
edit:
I just checked: the browser does not wait for callbacks to be called
As far as I can tell from digging in the source code, the result will be decided by either of the following methods:
JS_EvaluateScriptForPrincipalsJSEvaluateScriptSo it sounds like, if there's no error,
truewill be returned.As far as the async part of your question is concerned, the
Browserwill not wait for the execution of the async task. What you can do, however, is define aBrowserFunction(as shown in this example) and call that method from JavaScript when you're done with your async task.