executeJavaScript

abstract fun executeJavaScript(code: String, userGesture: Boolean = definedExternally): Promise<Any?>(source)

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

Evaluates code in page. If userGesture is set, it will create the user gesture context in the page. HTML APIs like requestFullScreen, which require user action, can take advantage of this option for automation.