I was wondering - when calling the org.eclipse.swt.browser.Browser
method execute,
return boolean
determined? javaScript
execution considered "successful"?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_EvaluateScriptForPrincipals
If the script compiles and executes successfully, *rval receives the value from the last-executed expression statement processed in the script, and JS_EvaluateScriptForPrincipals or JS_EvaluateUCScriptForPrincipals returns JS_TRUE. Otherwise it returns JS_FALSE, and the value left in *rval is undefined.
JSEvaluateScript
The value that results from evaluating script, or NULL if an exception is thrown.
So it sounds like, if there's no error, true
will be returned.
As far as the async part of your question is concerned, the Browser
will not wait for the execution of the async task. What you can do, however, is define a BrowserFunction
(as shown in this example) and call that method from JavaScript when you're done with your async task.