How to detect IE11?
C

16

217

When I want to detect IE I use this code:

function getInternetExplorerVersion()
{
  var rv = -1;
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
function checkVersion()
{
  var msg = "You're not using Internet Explorer.";
  var ver = getInternetExplorerVersion();

  if ( ver > -1 )
  {
    msg = "You are using IE " + ver;
  }
  alert( msg );
}

But IE11 is returning "You're not using Internet Explorer". How can I detect it?

Conscionable answered 28/7, 2013 at 10:49 Comment(7)
See also #17447873Aerosol
Or #9514679 for complete detectionVariolite
Anything based on user agent is flawed. It's too easy to spoof, Now, it may be that this is a not a problem, but it seems to me that a browser detection script should have a fair chance of detecting masquerading. I use a combination of conditional comments, fall-through to trying to coerce the document.documentMode and then look at window.MSInputMethodContext as per Paul Sweatte below. I'd post my code but it's flogging a dead horse.December
IE11 has user-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko Os types: 6.1 - win7, 6.3 - win81Finny
see my answer here #21825657Gage
here's the best solution I've found: https://mcmap.net/q/42099/-how-to-detect-ie-11-with-javascript-in-asp-net if (Object.hasOwnProperty.call(window, "ActiveXObject") && !window.ActiveXObject) { // is IE11 }Efficacious
another option: gist.github.com/CodeHeight/3ad11c1daf8907a53506b869a2251119.jsBattled
M
225

IE11 no longer reports as MSIE, according to this list of changes it's intentional to avoid mis-detection.

What you can do if you really want to know it's IE is to detect the Trident/ string in the user agent if navigator.appName returns Netscape, something like (the untested);

function getInternetExplorerVersion()
{
  var rv = -1;
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re = new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  else if (navigator.appName == 'Netscape')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

console.log('IE version:', getInternetExplorerVersion());

Note that IE11 (afaik) still is in preview, and the user agent may change before release.

Musetta answered 28/7, 2013 at 11:3 Comment(15)
it's intentional to avoid mis-detection - Sadly, now that IE11 is released, we have code that is broken in only IE11, whereas a correct detection of IE would have worked...Jennifferjennilee
I converted this solution to a Boolean if the version is less important function isIE() { return ((navigator.appName == 'Microsoft Internet Explorer') || ((navigator.appName == 'Netscape') && (new RegExp("Trident/.*rv:([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent) != null))); }Zackaryzacks
@lzkata - Per the html5 spec here, IE is actually following the standard. So yes, it's intentional, but it is per the new standard (deprecating the old html api.)Glaring
"the reason they did this was deliberate. They wanted to break browser detection scripts like this." from https://mcmap.net/q/42099/-how-to-detect-ie-11-with-javascript-in-asp-net ... Actually it should be: 'They wanted to make billion websites break like this.'Newmodel
This works for me: var isIE11 = !!navigator.userAgent.match(/Trident\/7\./); sourceNewmodel
I used your answer in a solution I created for developing and emulating in IE11. Thought I'd share: github.com/eivers88/IE11-Missing-Conditional-SolutionChu
Best not to use literals in new RegExp(). In this case "[\.0-9]" should be "[\\.0-9]". i.e. there's an unescaped backslash. Best to use the // form (as Echt does) instead. It doesn't require escaping backslash, and it's clearer to the parsers/linters it's meant to be a regexp rather than just a string.Likeness
Some versions of IE 11 actually do report MSIE, so watch out for false positives. Also, detecting Trident/ will definitely not be reliable once IE 12 comes out.Carbarn
Nice approach, but doesn't work if you select other than default User Agent String in Emulation tab of IE11, leaving document mode default (Edge).Glucinum
here's the best solution I've found: https://mcmap.net/q/42099/-how-to-detect-ie-11-with-javascript-in-asp-net if (Object.hasOwnProperty.call(window, "ActiveXObject") && !window.ActiveXObject) { // is IE11 }Efficacious
This works great for embeded PDF objects as well when Internet Explorer did their changes.Rickeyricki
why !! symbol is usedMerralee
Using IE 11, I noticed that any variable named isIE will always be false, even when it has been set to true. They thought of everything!Blintz
var isIE11 = navigator.userAgent.indexOf("Trident/7") > -1 seems most Occam-y. @Robin: What !! means, aka, "Kai could've left !! out."Columbous
I might be blind but the following regular expressions are just wrong: "MSIE ([0-9]{1,}[\.0-9]{0,})" "Trident/.*rv:([0-9]{1,}[\.0-9]{0,})" in both cases when there is a check for zero or more dot or number then since this is a double-quoted string they should read: "MSIE ([0-9]{1,}[.0-9]{0,})" "Trident/.*rv:([0-9]{1,}[.0-9]{0,})" Just came across this after turning the no-useless-escape ESLint rule. So it worked just because in character class matcher dot is a dot (not just any character) and a \. is also a dot. So maybe not wrong but that escaping for dot is not necessaryFabrikoid
A
89

Use !(window.ActiveXObject) && "ActiveXObject" in window to detect IE11 explicitly.

To detect any IE (pre-Edge, "Trident") version, use "ActiveXObject" in window instead.

Applicatory answered 8/11, 2013 at 20:35 Comment(11)
Omu - which version of Chrome? Both lines return false for me with Chrome 35.0.1916.114 mApplicatory
@Omu just tested in chrome 35.0.1916.114 on linux and it returns ''false''Sanctify
Just tested it. Works perfectly. I think 'ActiveXObject' in window is good enough for detecting any IE version.Woodhead
This Microsoft article suggests this solution may no longer work msdn.microsoft.com/en-us/library/ie/dn423948(v=vs.85).aspxAeropause
Actually, this article describes the reason why my method works. Attempting to access window.ActiveXObject, as described in the article, returns undefined in IE11 now (as well as non-Microsoft browsers.) The test using the javascript in operator returns true in all Microsoft browsers, so both are the case strictly in IE11. If Microsoft issues a change to the behavior of the in operator, yes, this method will break.Applicatory
"ActiveXObject" in window returns False in Edge.Snappish
@Snappish Edge is not IE, the OP's question was how to detect IE11Typist
@Typist yea but in this answer, it is mentioned that ActiveXObject can be used to detect any IE version. It is though debatable that should Edge be called a version of IE or not (Microsoft surely does not want to call it one), but for many of the developers IE has become the synonym for any default Microsoft browser.Snappish
This answer should be removed. This was working but lately it has been literally crashing IE for many users who are updating IE11.Barnhill
@stimpy77 - just tested in 11.420.10586.0 and Edge 25.10586.0.0. Not seeing a crash - can you be more specific?Applicatory
It may be environmental ("works on MY machine"), but no browser API behavior should be environmentally distinct. window.ActiveXObject is an unsafe API to begin with so this is unsurprising.Barnhill
F
47

Use MSInputMethodContext as part of a feature detection check. For example:

//Appends true for IE11, false otherwise
window.location.hash = !!window.MSInputMethodContext && !!document.documentMode;

References

Firstfoot answered 27/2, 2014 at 22:52 Comment(6)
This seems to me to be more robust. Certainly anything based on user agent is pretty useless.December
That's worked instead of ActiveXObject. Thanks a lotBrassbound
@tdakhla Updated to filter out IE Edge.Firstfoot
Important to note for any of these answers that might seem like they're not working is to check the Emulation settings, I was going to mark this answer as incorrect but then I checked emulation and saw that some intranet compatibility settings were overriding the display mode, once that was taken out of the equation this solution worked fine for me.Benevolent
Just confirmed #false in non-IE, IE8,9,10, Edge 14,15. #true in IE11 only. Did not test with document mode active. Tested with Browserstack.Invalid
This is working for me. Have a basic helper const isIE11 = () => !!window.MSInputMethodContext && !!document.documentMode;Breena
C
15

I've read your answers and made a mix. It seems to work with Windows XP(IE7/IE8) and Windows 7 (IE9/IE10/IE11).

function ie_ver(){  
    var iev=0;
    var ieold = (/MSIE (\d+\.\d+);/.test(navigator.userAgent));
    var trident = !!navigator.userAgent.match(/Trident\/7.0/);
    var rv=navigator.userAgent.indexOf("rv:11.0");

    if (ieold) iev=new Number(RegExp.$1);
    if (navigator.appVersion.indexOf("MSIE 10") != -1) iev=10;
    if (trident&&rv!=-1) iev=11;

    return iev;         
}

Of course if I return 0, means no IE.

Culver answered 28/12, 2013 at 13:48 Comment(0)
C
13

Get IE Version from the User-Agent

var ie = 0;
try { ie = navigator.userAgent.match( /(MSIE |Trident.*rv[ :])([0-9]+)/ )[ 2 ]; }
catch(e){}

How it works: The user-agent string for all IE versions includes a portion "MSIE space version" or "Trident other-text rv space-or-colon version". Knowing this, we grab the version number from a String.match() regular expression. A try-catch block is used to shorten the code, otherwise we'd need to test the array bounds for non-IE browsers.

Note: The user-agent can be spoofed or omitted, sometimes unintentionally if the user has set their browser to a "compatibility mode". Though this doesn't seem like much of an issue in practice.


Get IE Version without the User-Agent

var d = document, w = window;
var ie = ( !!w.MSInputMethodContext ? 11 : !d.all ? 99 : w.atob ? 10 : 
d.addEventListener ? 9 : d.querySelector ? 8 : w.XMLHttpRequest ? 7 : 
d.compatMode ? 6 : w.attachEvent ? 5 : 1 );

How it works: Each version of IE adds support for additional features not found in previous versions. So we can test for the features in a top-down manner. A ternary sequence is used here for brevity, though if-then and switch statements would work just as well. The variable ie is set to an integer 5-11, or 1 for older, or 99 for newer/non-IE. You can set it to 0 if you just want to test for IE 1-11 exactly.

Note: Object detection may break if your code is run on a page with third-party scripts that add polyfills for things like document.addEventListener. In such situations the user-agent is the best option.


Detect if the Browser is Modern

If you're only interested in whether or not a browser supports most HTML 5 and CSS 3 standards, you can reasonably assume that IE 8 and lower remain the primary problem apps. Testing for window.getComputedStyle will give you a fairly good mix of modern browsers, as well (IE 9, FF 4, Chrome 11, Safari 5, Opera 11.5). IE 9 greatly improves on standards support, but native CSS animation requires IE 10.

var isModernBrowser = ( !document.all || ( document.all && document.addEventListener ) ); 
Cyndie answered 18/6, 2015 at 5:54 Comment(4)
the 'Get IE Version from the User-Agent' work nicely! just to be sure, this will show all version including IE11?Frothy
@Frothy Yes, because it looks for the string "MSIE" or "Trident"; the latter is used by IE 11 and above. So it will work for all future IE versions until MS changes the name of its browser engine. I believe the new Edge browser still uses Trident.Cyndie
This works great, thanks @Beejor! I implemented a simple redirect to another page using your answer: var ie = 0; try { ie = navigator.userAgent.match( /(MSIE |Trident.*rv[ :])([0-9]+)/ )[ 2 ]; } catch(e){} if (ie !== 0) { location.href = "../ie-redirect/redirect.html"; } Mountainside
@Mountainside Looks good! A quick tip: if you have access to the server, detecting the user-agent in a script there may work better, since the user wouldn't notice any redirect/flicker, less HTTP requests, etc. But in a pinch doing it with JS works too.Cyndie
J
10

Angular JS does this way.

msie = parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1]);
if (isNaN(msie)) {
  msie = parseInt((/trident\/.*; rv:(\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1]);
}

msie will be positive number if its IE and NaN for other browser like chrome,firefox.

why ?

As of Internet Explorer 11, the user-agent string has changed significantly.

refer this :

msdn #1 msdn #2

Jecoa answered 19/8, 2014 at 10:3 Comment(0)
C
7

solution :

function GetIEVersion() {
  var sAgent = window.navigator.userAgent;
  var Idx = sAgent.indexOf("MSIE");
  // If IE, return version number.
  if (Idx > 0)
    return parseInt(sAgent.substring(Idx+ 5, sAgent.indexOf(".", Idx)));

  // If IE 11 then look for Updated user agent string.
  else if (!!navigator.userAgent.match(/Trident\/7\./))
    return 11;

  else
    return 0; //It is not IE

}
if ((GetIEVersion() > 0) || (navigator.userAgent.toLowerCase().indexOf('firefox') > -1)){
  alert("This is IE " + GetIEVersion());
}else {
  alert("This no is IE ");
}		
Clarenceclarenceux answered 11/9, 2015 at 5:59 Comment(2)
My favorite - accounts for IE6-10 and IE11. I added in a check for edge as wellAgentive
This detects Firefox as This is IE 0Goaltender
S
3

I'm using a simpler method:

The navigator global object has a property touchpoints, in Internet Exlorer 11 is called msMaxTouchPoints tho.

So if you look for:

navigator.msMaxTouchPoints !== void 0 

You will find Internet Explorer 11.

Slapjack answered 23/6, 2014 at 1:39 Comment(1)
It also returns trun on IE 10 (Win 7)Flea
C
2
var ua = navigator.userAgent.toString().toLowerCase();
var match = /(trident)(?:.*rv:([\w.]+))?/.exec(ua) ||/(msie) ([\w.]+)/.exec(ua)||['',null,-1];
var rv = match[2];
return rv;
Constanta answered 12/8, 2013 at 1:18 Comment(1)
If you are using a regex to chec you can add the i flag to make it case insensitive, rather than .toLowerCase(). There is also no need for the .toString() method.Fishworm
J
2

Try This:

var trident = !!navigator.userAgent.match(/Trident\/7.0/);
var net = !!navigator.userAgent.match(/.NET4.0E/);
var IE11 = trident && net
var IEold = ( navigator.userAgent.match(/MSIE/i) ? true : false );
if(IE11 || IEold){
alert("IE")
}else{
alert("Other")
}
Jargon answered 24/10, 2013 at 10:55 Comment(5)
Wrong code because Acoo browser uses "MSIE" in the useragent. Look at useragentstring.com/pages/Acoo%20BrowserChannelize
WRONG ARGUMENT. I have tested across all IE browsers, even Win8 devices as well.Jargon
You tested IE11 browser but not Acoo browser and Acoo browser uses "MSIE" in the useragent like i say'd you so the IEold also detects Acoo browser as IEold (The old version of IE) and i'm sure that Acoo browser uses "MSIE" in the useragent because i've did navigator.userAgent on a javascript test site with Acoo browser (Test site: w3schools.com)Channelize
Can you please give a better solution for this?Jargon
U can use !navigator.userAgent.match("Acoo Browser;") && navigator.userAgent.match(/MSIE/i) ? true : false but that does not always work because acoo browser does not always have "Acoo Browser;" in its useragent but actually u don't need to care about that acoo browser has "MSIE" in its useragent because acoo browser is almost thesame.Channelize
C
1

This appears to be a better method. "indexOf" returns -1 if nothing is matched. It doesn't overwrite existing classes on the body, just adds them.

// add a class on the body ie IE 10/11
var uA = navigator.userAgent;
if(uA.indexOf('Trident') != -1 && uA.indexOf('rv:11') != -1){
    document.body.className = document.body.className+' ie11';
}
if(uA.indexOf('Trident') != -1 && uA.indexOf('MSIE 10.0') != -1){
    document.body.className = document.body.className+' ie10';
}
Cletacleti answered 16/7, 2014 at 9:45 Comment(0)
A
0

Detect most browsers with this:

var getBrowser = function(){
  var navigatorObj = navigator.appName,
      userAgentObj = navigator.userAgent,
      matchVersion;
  var match = userAgentObj.match(/(opera|chrome|safari|firefox|msie|trident)\/?\s*(\.?\d+(\.\d+)*)/i);
  if( match && (matchVersion = userAgentObj.match(/version\/([\.\d]+)/i)) !== null) match[2] = matchVersion[1];
  //mobile
  if (navigator.userAgent.match(/iPhone|Android|webOS|iPad/i)) {
    return match ? [match[1], match[2], mobile] : [navigatorObj, navigator.appVersion, mobile];
  }
  // web browser
  return match ? [match[1], match[2]] : [navigatorObj, navigator.appVersion, '-?'];
};

https://gist.github.com/earlonrails/5266945

Agitate answered 2/10, 2014 at 20:44 Comment(0)
B
0

I used the onscroll event at the element with the scrollbar. When triggered in IE, I added the following validation:

onscroll="if (document.activeElement==this) ignoreHideOptions()"
Bitterroot answered 8/4, 2015 at 13:37 Comment(0)
V
0

Only for IE Browser:

var ie = 'NotIE'; //IE5-11, Edge+
    if( !!document.compatMode ) {
        if( !("ActiveXObject" in window) ) ) ie = 'EDGE';
        if( !!document.uniqueID){
            if('ActiveXObject' in window && !window.createPopup ){ ie = 11; }
            else if(!!document.all){
                    if(!!window.atob){ie = 10;}
                    else if(!!document.addEventListener) {ie = 9;}
                    else if(!!document.querySelector){ie = 8;}
                    else if(!!window.XMLHttpRequest){ie = 7;}
                    else if(!!document.compatMode){ie = 6;}
                    else ie = 5;
                }
        }
    }

use alert(ie);

Testing:

var browserVersionExplorer = (function() {
    var ie = '<s>NotIE</s>',
        me = '<s>NotIE</s>';

    if (/msie\s|trident\/|edge\//i.test(window.navigator.userAgent) && !!(document.documentMode || document.uniqueID || window.ActiveXObject || window.MSInputMethodContext)) {
            if (!!window.MSInputMethodContext) {
                ie = !("ActiveXObject" in window) ? 'EDGE' : 11;
            } else if (!!document.uniqueID) {
                if (!!(window.ActiveXObject && document.all)) {
                    if (document.compatMode == "CSS1Compat" && !!window.DOMParser ) {
                        ie = !!window.XMLHttpRequest ? 7 : 6;
                    } else {
                        ie = !!(window.createPopup && document.getElementById) ? parseFloat('5.5') : 5;
                    }
                    if (!!document.documentMode && !!document.querySelector ) {
                        ie = !!(window.atob && window.matchMedia) ? 10 : ( !!document.addEventListener ? 9 : 8);
                    }
                } else ie = !!document.all ? 4 : (!!window.navigator ? 3 : 2);
            }
        }
        
    return ie > 1 ? 'IE ' + ie : ie;
})();

 alert(browserVersionExplorer);

Update 01 Jun 2017

Now we could use something easier and simpler:

var uA = window.navigator.userAgent,
    onlyIEorEdge = /msie\s|trident\/|edge\//i.test(uA) && !!( document.uniqueID || window.MSInputMethodContext),
    checkVersion = (onlyIEorEdge && +(/(edge\/|rv:|msie\s)([\d.]+)/i.exec(uA)[2])) || NaN;
Volcanism answered 19/1, 2016 at 17:17 Comment(6)
Where can I find the new standard global objects added to new versions of Edge? I infer Math.acosh is one of those.Inness
@Inness Math.acosh Only is Supported in Microsoft Edge (Edge browser). Ref: msdn.microsoft.com/en-us/en-en/library/dn858239(v=vs.94).aspxVolcanism
This method stoped working for me. In the past it correctly detected IE11 but now that I have Internet Explorer version 11.1198.14393.0 (Update version 11.0.42 (KB4018271)) running on Windows 10 Enterprise (version 1607, OS Build 14393.1198) Math seems to support the acosh method.Determined
@Determined In Windows 10 Education with IE11 v 11.1198.14393.0 I tested successfully. You should try another math function according to ES6.Volcanism
@JamesPeter I've landed upon checking for document.documentMode. This seems to be a more reliable property to check for IE11 or Edge. documentMode exists in IE11 but no longer exists in Edge.Determined
Yes, documentMode exists since IE8-10, and document.compatMode exists since it exists since IE5- *. However the latter is disapproved from IE8 but is still used. Thanks for sharing.Volcanism
F
0

Quite frankly I would say use a library that does what you need (like platform.js for example). At some point things will change and the library will be equipped for those changes and manual parsing using regular expressions will fail.

Thank god IE goes away...

Fabrikoid answered 14/1, 2018 at 22:6 Comment(0)
G
-1

Use DetectOS.js. This is a simple JS definition for popular operating systems and browsers without dependencies:

class DetectOS {
    constructor() {
        this.browser = this.searchString(this.dataBrowser())
        this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion)
        this.OS = this.searchString(this.dataOS())
    }

    searchString(data) {
        for (let i = 0; i < data.length; i++) {
            let
                dataString = data[i].string,
                dataProp = data[i].prop
            this.versionSearchString = data[i].versionSearch || data[i].identity
            if (dataString) {
                if (dataString.indexOf(data[i].subString) !== -1) {
                    return data[i].identity
                }
            } else if (dataProp) {
                return data[i].identity
            }
        }
    }

    searchVersion(dataString) {
        let index = dataString.indexOf(this.versionSearchString)
        if (index === -1) return
        return parseFloat(dataString.substring(index+this.versionSearchString.length + 1))
    }

    dataBrowser() {
        return [
            /***************
             * Chrome
             ***************/
            {
                string: navigator.userAgent,
                subString: "Chrome",
                identity: "Chrome"
            },
            /***************
             * Safari
             ***************/
            {
                string: navigator.vendor,
                subString: "Apple",
                identity: "Safari",
                versionSearch: "Version"
            },
            /***************
             * For Older Opera (12.18-)
             ***************/
            {
                prop: window.opera,
                identity: "Opera",
                versionSearch: "Version"
            },
            /***************
             * Internet Explorer 10
             ***************/
            {
                string: navigator.userAgent,
                subString: "MSIE",
                identity: "IE10",
                versionSearch: "MSIE"
            },
            /***************
             * Internet Explorer 11
             ***************/
            {
                string: navigator.userAgent,
                subString: "Trident",
                identity: "IE11",
                versionSearch: "rv"
            },
            /***************
             * Edge
             ***************/
            {
                string: navigator.userAgent,
                subString: "Edge",
                identity: "Edge",
                versionSearch: "Edge"
            },
            /***************
             * Firefox
             ***************/
            {
                string: navigator.userAgent,
                subString: "Firefox",
                identity: "Firefox"
            },
            {
                string: navigator.userAgent,
                subString: "Gecko",
                identity: "Mozilla",
                versionSearch: "rv"
            },
            /***************
             * For Older Netscapes (4-)
             ***************/
            {
                string: navigator.userAgent,
                subString: "Mozilla",
                identity: "Netscape",
                versionSearch: "Mozilla"
            },
            /***************
             * For Newer Netscapes (6+)
             ***************/
            {
                string: navigator.userAgent,
                subString: "Netscape",
                identity: "Netscape"
            },
            /***************
             * Other Browsers
             ***************/
            {
                string: navigator.userAgent,
                subString: "OmniWeb",
                versionSearch: "OmniWeb/",
                identity: "OmniWeb"
            },
            {
                string: navigator.vendor,
                subString: "iCab",
                identity: "iCab"
            },
            {
                string: navigator.vendor,
                subString: "KDE",
                identity: "Konqueror"
            },
            {
                string: navigator.vendor,
                subString: "Camino",
                identity: "Camino"
            }
        ]
    }

    dataOS() {
        return [
            {
                string: navigator.platform,
                subString: 'Win',
                identity: 'Windows'
            },
            {
                string: navigator.platform,
                subString: 'Mac',
                identity: 'macOS'
            },
            {
                string: navigator.userAgent,
                subString: 'iPhone',
                identity: 'iOS'
            },
            {
                string: navigator.userAgent,
                subString: 'iPad',
                identity: 'iOS'
            },
            {
                string: navigator.userAgent,
                subString: 'iPod',
                identity: 'iOS'
            },
            {
                string: navigator.userAgent,
                subString: 'Android',
                identity: 'Android'
            },
            {
                string: navigator.platform,
                subString: 'Linux',
                identity: 'Linux'
            }
        ]
    }
}

const Detect = new DetectOS()

console.log("We know your browser – it's " + Detect.browser + " " + Detect.version);
console.log("We know your OS – it's " + Detect.OS);
console.log("We know everything about you.");
Goodsized answered 26/6, 2021 at 8:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.