I'm trying to use the new evaluateJavascript method in Android 4.4, but when i try to evaluate this javascript code
browser.evaluateJavascript("(function() { document.getElementById('login').value='"+username+"'; document.getElementById('password').value='"+password+"'; document.getElementsByTagName('input')[2].click(); return '';})();",new ValueCallback<String>() {
@Override public void onReceiveValue(String s) {
}
});
the app crashes returning:
Fatal signal 6 (SIGABRT) at 0x00006225 (code=-6), thread 25125
the javascript code is correct, because with the old way
browser.loadUrl("javascript:(function() { ...
it works.
doing some tests, i've found that the problem is when is executed the function
document.getElementsByTagName('input')[2].click();
the input is a submit button, that sends a form.
how can i do to fill the form and send it?