Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

version check

navigator.sayswho= (function(){
    var ua= navigator.userAgent, tem, 
    M= ua.match(/(opera|chrome|safari|firefox|brave|msie|trident(?=/))/?s*(d+)/i) || [];
    if(/trident/i.test(M[1])){
        tem=  /rv[ :]+(d+)/g.exec(ua) || [];
        return 'IE '+(tem[1] || '');
    }
    if(M[1]=== 'Chrome'){
        tem= ua.match(/(OPR|Edge)/(d+)/);
        if(tem!= null) return tem.slice(1).join(' ').replace('OPR', 'Opera');
    }
    M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
    if((tem= ua.match(/version/(d+)/i))!= null) M.splice(1, 1, tem[1]);
    return M.join(' ');
})();

console.log(navigator.sayswho); // outputs: `Chrome 62`
Comment

PREVIOUS NEXT
Code Example
Javascript :: node import json 
Javascript :: ternary 
Javascript :: localstorage.setitem 
Javascript :: custom search filter in angular 8 
Javascript :: ajax post csrf codeigniter 
Javascript :: express ubuntu ERR_CONNECTION_REFUSED 
Javascript :: node express 
Javascript :: how to not use relative imports in react js 
Javascript :: got bearer auth 
Javascript :: js array reduce 
Javascript :: json date serialize 
Javascript :: js how to to attach an event handler only once 
Javascript :: hover on child from parent mui react 
Javascript :: javascript if 
Javascript :: sort method js 
Javascript :: puppeteer waitforselector 
Javascript :: react useeffect on change props 
Javascript :: es6 modules node 
Javascript :: check if browser is chrome mobile 
Javascript :: having written a counter with redux how does it work 
Javascript :: how to inspect element attributes in cypress 
Javascript :: if text is present make div hide 
Javascript :: access text inside a button from js 
Javascript :: using connect flash 
Javascript :: password regex javascript 
Javascript :: npm remopve existing files 
Javascript :: Repeat a String Repeat a String-Javascript 
Javascript :: install node specific version ubuntu 
Javascript :: jquery find attribute from siblings 
Javascript :: count number of times an element is occuring in an array in javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =