javascript to detect browser
//gets the type of browser
function detectBrowser() {
if((navigator.userAgent.indexOf("Opera") || navigator.userAgent.indexOf('OPR')) != -1 ) {
return 'Opera';
} else if(navigator.userAgent.indexOf("Chrome") != -1 ) {
return 'Chrome';
} else if(navigator.userAgent.indexOf("Safari") != -1) {
return 'Safari';
} else if(navigator.userAgent.indexOf("Firefox") != -1 ){
return 'Firefox';
} else if((navigator.userAgent.indexOf("MSIE") != -1 ) || (!!document.documentMode == true )) {
return 'IE';//crap
} else {
return 'Unknown';
}
}
Also in JavaScript:
- how to define state in react function
- how to deap clone an object in javascript
- get current time epoch javascript
- js .substring
- js array includes
- duplicate characters in a string javascript
- javascript limit input to 2 decimal places
- billie eilish
- javascript http request
- javascript split get last element
- get current date javascript full month
- componentwillreceiveprops hooks
- Run project in visual studio with iis express
- append to top javascript
- export html page to pdf on user click using javascript.
- BottomNavigationBar rebuilds Page on change of tab
- jquery.treegrid.js
- how to refresh the page using react
- odoo submit form using js and display data
- add select option jquery
- arraylist to json array
- hot to start cypress
- download videos "hotmart" javascript github
- how store array in another array js