evaluateJavaScript

Execute the Javascript code and get the response in callback.

Parameters

javaScriptExpression

the passed JavaScript code should be either:

  • a valid single-line JavaScript expression

  • a valid multi-line function-body with at least one "return" statement

callback

a KCEFFrame.EvaluateJavascriptCallback listener to handle the response


suspend fun evaluateJavaScript(javaScriptExpression: String): String?(source)

Execute the Javascript code and wait for a response. This suspend equivalent is useful if you want to work with timeouts for example.

Return

a nullable String which is the response

Parameters

javaScriptExpression

the passed JavaScript code should be either:

  • a valid single-line JavaScript expression

  • a valid multi-line function-body with at least one "return" statement

See also