daily pastebin goal
12%
SHARE
TWEET

Untitled

a guest Oct 17th, 2018 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * @returns {String} 当前浏览器名称
  3.  */
  4. export const getExplorer = () => {
  5.     const ua = window.navigator.userAgent
  6.     const isExplorer = (exp) => {
  7.         return ua.indexOf(exp) > -1
  8.     }
  9.     if (isExplorer('MSIE')) return 'IE'
  10.     else if (isExplorer('Firefox')) return 'Firefox'
  11.     else if (isExplorer('Chrome')) return 'Chrome'
  12.     else if (isExplorer('Opera')) return 'Opera'
  13.     else if (isExplorer('Safari')) return 'Safari'
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top