This article will help you solving browser compatibility issue. To make detection more robust, here included browser-specific characteristics which is different according to browser.

Opera 8.0+

var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;

Firefox 1.0+

var isFirefox = typeof InstallTrigger !== 'undefined';

Safari 9.1.3+

var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || safari.pushNotification);

Internet Explorer 6-11

var isIE = /*@cc_on!@*/false || !!document.documentMode;

Chrome 1+

var isChrome = !!window.chrome && !!window.chrome.webstore;

Successfully tested in:

  • Firefox 0.8 - 44
  • Chrome 1.0 - 48
  • Opera 8.0 - 34
  • Safari 3.0 - 10
  • IE 6 - 11

If you have any suggestion for this post then welcome