UiWebViewClient

lumin.ui. UiWebViewClient

UiWebViewClient Applications should implement this interface
to receive events from UiWebView. Register an instance of
UiWebViewClient with the UiWebView instance using the API:
'setWebViewClient'.

Constructor

new UiWebViewClient()

Methods

onBeforeResourceLoad(webview, resource_url)

Notify the host application that resource will be loaded.

Parameters:
Name Type Description
webview lumin.ui.UiWebView

the UiWebView that triggered this call.

resource_url string

the url of the resource about to be loaded.

onExternalProtocol(webview, url)

Notify host application to handle external schemes/protocols (that
are not handled by webview). Any non-standard browser schemes
(other than: http, https, file etc) are treated as external schemes.

Parameters:
Name Type Description
webview lumin.ui.UiWebView

the UiWebView that triggered this call.

url string

the url for external scheme or protocol

onLoadEnd(webview, is_main_frame, http_error_code)

Notify host application of load completion. http error code is set if any error
occurred. 0 error code implies no error.

Parameters:
Name Type Description
webview lumin.ui.UiWebView

the UiWebView that triggered this call.

is_main_frame boolean

if this event was for the main frame.

http_error_code number

the standard http error code, 0 is returned for success.

onLoadError(webview, is_main_frame, error_code, error_str, failed_url)

Notify host application of load error. These errors could be due to connectivity,
certificate errors etc. The error string is the stringified version of the
error code.

Parameters:
Name Type Description
webview lumin.ui.UiWebView

the UiWebView that triggered this call.

is_main_frame boolean

if this event was for the main frame.

error_code number

error code for the error

error_str string

human readable error string

failed_url string

the url that caused the load error