It has come to my attention that the head.js
script is unable to detect the Microsoft "Edge" browser correctly. In addition, it erroneously adds classes like chrome
and chrome55
to the <html>
element.
Is there a better way to handle this issue? The solution I thought of involves manually checking for the "Edge" browser in my application's bootstrap process, adding the appropriate "ms-edge" class, and removing the incorrect "chrome" classes added by head.js:
if (window.navigator.userAgent.indexOf('Edge') > -1) {
$('html').removeClass(function(index, classes) {
return classes.match(/\bchrome.*?\b/g).join(' ');
}).addClass('ms-edge');
}