V
V
Valery2016-09-18 23:12:01
Android
Valery, 2016-09-18 23:12:01

How to catch JS error in Android Browser?

There is an admin panel that works perfectly on the desktop: IE10+ and all modern browsers.
Nothing special: React + Redux with some goodies.
It also works great in mobile chrome.
But it completely refuses to work in the standard Adnroid Browser.
Arc phone (something there), Android 5.1.
After loading JS, as if it doesn't work. No errors, no response.
I installed Firebug Lite, I thought maybe the error console will show - it's empty.
How it is possible to debug this miracle? To mob. you can connect a computer to chrome, but to this ... can you?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Melnikov, 2016-09-19
@mlnkv

window.onerror = function(e) {
  alert(e.message, e.filename, e.lineno)
}

V
Vladimir, 2016-09-19
@naivekook

try

webView.setWebChromeClient(new WebChromeClient() {
    @Override
    public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
        android.util.Log.d("WebView", consoleMessage.message());
        return true;
    }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question