2 ms·
And it does it in the worst way: if(navigator.userAgent.indexOf("Chrome") != -1 ){ } else { location.replace("https://bestsnip.com/browser_not_supported/");
by chrismorgan 6y ago
And it does it in the worst way:
if(navigator.userAgent.indexOf("Chrome") != -1 ){ } else { location.replace("https://bestsnip.com/browser_not_supported/"); };
Such user agent sniffing should be strenuously avoided. If there’s a particular feature you need, such as WebM with the VP9 codec, do feature detection instead:
if (!document.createElement('video').canPlayType('video/webm;codecs="vp9"')) {
location.replace("https://bestsnip.com/browser_not_supported/");
}
(For reference, that canPlayType call returns "probably" for me on Firefox and Chrome, and would return an empty string in an environment that didn’t support WebM or the VP9 codec.)