Dart is not supported in some browsers, especially in some mobile browsers, such as the Android browser. Instead of popping up, I would like to show the message "not supported".
So, we have a JS that generates a DIV with the message “not supported” if it detects supposedly unsupported devices:
var ua = navigator.userAgent.toLowerCase();
// Android 1-4
if (/android [1-4]/i.test(ua)) {
window.document.querySelector('#mobile-not-supported').style.display = '';
window.document.querySelector('#application-root-container').style.display = 'none';
}
The problem is that this is shown for some devices where it really works. For example, on some Android devices, it works in the Chrome browser, and not in the browser.
What is the best approach here? I'm not even sure about the strict list of supported browsers (there is only this: https://www.dartlang.org/support/faq.html#q-what-browsers-do-you-support-as-javascript-compilation-targets ) . Ideally, it is possible for JS to detect that some aspect of the application is not working, and only show the message “not supported” in these cases.
source
share