Guest User

Untitled

a guest
Aug 25th, 2019
103
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