Guest User

Untitled

a guest
Jul 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. function isIE9() {
  2. return navigator.appName.indexOf('Internet Explorer') !== -1 && navigator.appVersion.indexOf("MSIE 9") !== -1;
  3. }
  4.  
  5. function isIE10() {
  6. return navigator.appName.indexOf('Internet Explorer') !== -1 && navigator.appVersion.indexOf("MSIE 10") !== -1;
  7. }
  8.  
  9. function isOldIE() {
  10. return isIE9() || isIE10();
  11. }
  12.  
  13. function isIE() {
  14. return ((navigator.appName === 'Microsoft Internet Explorer') || ((navigator.appName === 'Netscape') && (new RegExp('Trident/.*rv:([0-9]{1,}[.0-9]{0,})').exec(navigator.userAgent) !== null)));
  15. }
  16.  
  17. // If the browser is Edge, returns the version number as a float, otherwise returns 0
  18. function getEdgeVersion() {
  19. var match = /Edge\/(\d+[,.]\d+)/.exec(navigator.userAgent);
  20. if (match !== null) {
  21. return +match[1];
  22. }
  23. return 0;
  24. }
  25.  
  26. function isFirefox() {
  27. return navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
  28. }
  29.  
  30. function isSafari() {
  31. return navigator.userAgent.toLowerCase().indexOf('safari') !== -1;
  32. }
  33.  
  34. function isChrome(){
  35. return window.chrome !== undefined
  36. }
Add Comment
Please, Sign In to add comment