I'm getting the next error on some phones that doesn't have an updated webview engine, or have weird browers that aren't supported by cordova webview.
07-27 13:50:47.233 14356-14356/com.locknot I/chromium: [INFO:CONSOLE(1)] "Uncaught TypeError: Object.assign is not a function", source: file:///android_asset/www/vendor.6356da77cc5903aae591.bundle.js (1)
I want to catch this error, in order to show to the user a dialog saying that his phone is not compatible.
How I can do that? Sorry for my english.
You can extend the WebChromeClient class and override its onConsoleMessage() method. This method receives all the console messages from within the website it is showing. Finally, set the instance of this WebChromeClient to the WebView via setWebChromeClient() method. So the Kotlin code would look something like this: