Stop sniffing the User-Agent, use feature detection
The Mattermost web interface uses the User-Agent of the browser, which is a bad idea because browsers can (and do) anyway lie about which browser they are.
As a matter of fact, right now Mattermost will give a warning (and not work) when e.g. using Epiphany (the GNOME Web browser), but changing the User-Agent does work. Because its engine is WebKit, which makes it to support almost everything that Safari does (and Safari is in the list of supported browsers).
What Mattermost should do is feature detection. More info at: https://github.com/mattermost/platform/issues/3353#event-703118004
-
Carlos Lopez commented
A better advice: just use Modernizr https://modernizr.com/ and read this good article about making the Web work for everyone: https://hacks.mozilla.org/2016/07/make-the-web-work-for-everyone/
-
Carlos Lopez commented
Indeed, the html5test.com page is a good example of how to use feature detection. You will be surprised to know that Epiphany gets an score of 416 there (which is better than, for example, Safari 9 or iOS 9 that get 400 or 409 respectively).
You can check https://github.com/NielsLeenheer/html5test/blob/version-8.0/scripts/8/engine.js to see how that page manages to detect the features of the browser without sniffing/parsing the user-agent.