Hey guys I wanted to inject some code into a webview and see whether the code has succeeded. I've tried to override the onConsoleMessage method of WebChromeClient but it only reports whether the code is an uncaught reference
public boolean onConsoleMessage (ConsoleMessage consoleMessage){
System.out.println(consoleMessage.message());
}
I only get messages like:
Uncaught ReferenceError: noob is not defined
When I execute a valid command like
document.getElementById("mainPage").innerHTML = "Hello Dolly.";
I would want to somehow know that the command succeeded or failed. The content of mainPage div changed fine but I got no messages from the onConsole method whether the command finished with success or not. Any idea what I could do? Thanks in advance