I've noticed that head.js
doesn't detect Microsoft "Edge" browser, and to top that, it adds incorrect chrome
and chrome55
classes to the <html>
element.
Does anyone know of a suitable way to approach this issue? The best approach I could come up with is to perform this check in my app's bootstrap - manually detect "Edge" browser, add appropriate "ms-edge" class, and remove head.js incorrect "chrome" classes:
if (window.navigator.userAgent.indexOf('Edge') > -1) {
$('html').removeClass(function(index, classes) {
return classes.match(/\bchrome.*?\b/g).join(' ');
}).addClass('ms-edge');
}
you should be using some thin like this
In the above string you need to check your conditions as below
Screen shots of various test in the browser console.