Evaluate

interface Evaluate<T> : WebViewRequest<T>

If you want to evaluate javascript in the webview, use this.

The javascriptToEvaluate is evaluated when the webview stops loading a URL with the stopUrlRegex and the result is passed to the onStop method.

You can also use javascriptToEvaluateOnPageStart to evaluate javascript when the webview starts loading a URL. Its result is not passed to the onStop method.

The javascript code should be wrapped in a function that returns some data.

See also

Properties

Link copied to clipboard
open val dontCache: Boolean

If you want to disable caching of the webview data, set this to true.

Link copied to clipboard

The initial URL to be loaded in the webview.

Link copied to clipboard

The javascript to be evaluated in the webview. Make sure this js code is wrapped in a function that can return some data.

Link copied to clipboard

The javascript to be evaluated when the webview starts loading a URL. This is useful for setting up the webview before it loads the URL.

Link copied to clipboard
open val maxTimeout: Long

The maximum time to wait for data to be returned from the webview. This is in milliseconds.

Link copied to clipboard
abstract val stopUrlRegex: <Error class: unknown class>

The regex to match the URL when the request is assumed to be complete. Checks on all requests made by the webview.

Functions

Link copied to clipboard
abstract suspend fun onStop(url: NetworkRequest, data: String?): T?

Called when the webview stops loading a URL with the stopUrlRegex and the javascript is evaluated.