1

I want to get the name of browser i am using.Currently i am trying 'navigator.userAgent' but it shows 'chrome' for both edge and chrome browser.

1
  • **You can find the solutions on this ** link Commented Mar 21, 2017 at 9:23

2 Answers 2

8

This is working I am too using it .It will show perfect browser name .Here is the demo

var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
    // Firefox 1.0+
var isFirefox = typeof InstallTrigger !== 'undefined';
    // At least Safari 3+: "[object HTMLElementConstructor]"
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
    // Internet Explorer 6-11
var isIE = /*@cc_on!@*/false || !!document.documentMode;
    // Edge 20+
var isEdge = !isIE && !!window.StyleMedia;
    // Chrome 1+
var isChrome = !!window.chrome && !!window.chrome.webstore;
    // Blink engine detection
var isBlink = (isChrome || isOpera) && !!window.CSS;
Sign up to request clarification or add additional context in comments.

1 Comment

Worked for me too.Thanks a lot.
0

Best way is to detect is jquery-migrate with minimum and tested code which is designed to resolve any compatibility issues before using jQuery Migrate 3.0 and upgrading to jQuery 3.0.

if($.browser.mozilla) {

} 
else if($.browser.chrome) {

} 
... go on

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.