I need to catch an error when invoking javascript from android's webview; if the javascript is missing I need to catch some event and do something else in android instead.
for instance, I have webview.loadUrl("javascript:doSomething");
the page is missing 'doSomething', so I can see the following error in logcat:
ReferenceError: Can't find variable: doSomething ...
I need to catch this error and handle it, for instance something like
public override void onJsErrorReceived(String errorDescription)
{
if(errorDescription.contains("doSomething"))
handleError();
}
I can't find any such event in webview, nor in the clients of webview (WebChromeClient and WebViewClient) to overridel.
Does anybody have an idea?
Thanks