browser detection, feature detection and sniffing ('tis a complex web)

We support IE9+, Chrome, FF and Safari but not mobile or Opera..we want to warn users on unsupported browsers

Understand browser sniffing is bad (too volatile: opera is webkit, IE11 is not IE etc), feature detection is better
check this ou: IE11 pretends not to be IE (I'd probably do same if I had family like that!). So you can't browser sniff for "MSIE" since its not there any more in IE11.

Our solution, we do a mix of feature detection and browser sniff
1. first feature detect: check for window.performance which is supported in IE9+, Chrome and FF..great! but also Opera and wekbit mobile...but not Safari
So we browser sniff to exclude Opera and Mobile

2. if no window.performance then check for Safai by browser sniff navigator.userAgent


I don't like it and its not ideal but best thus far.

Comments

Popular posts from this blog

deep dive into Material UI TextField built by mui

angular js protractor e2e cheatsheet

react-router v6.4+ loaders, actions, forms and more