executeJavaScript

abstract fun executeJavaScript(code: String, userGesture: Boolean = definedExternally, callback: (result: Any?, JsError) -> Unit = definedExternally): Promise<Any?>(source)

A promise that resolves with the result of the executed code or is rejected if execution throws or results in a rejected promise.

Evaluates code in page.

In the browser window some HTML APIs like requestFullScreen can only be invoked by a gesture from the user. Setting userGesture to true will remove this limitation.