SHARE
TWEET

Untitled

a guest Aug 25th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // only google chrome
  2. const isChrome = (userAgent) => /^.(?!.*samsungbrowser).*chrome(?!.*opr|.*edg|.*Puffin|.*SamsungBrowser|.*YaBrowser|.*miui).*$/i.test(userAgent)
  3.  
  4. // only safari browser
  5. const isSafari = (userAgent) => /^((?!chrome|android|opios|fxios).)*safari/i.test(userAgent);
  6.  
  7. // only edge based on chrome
  8. const isEdge = (userAgent) =>/^.*edge?\//i.test(userAgent);
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