Skip to content

Instantly share code, notes, and snippets.

@borispoehland
Created February 24, 2021 13:47
Show Gist options
  • Save borispoehland/c03a22b01e9f932e0a5ee47da8f0c3fb to your computer and use it in GitHub Desktop.
Save borispoehland/c03a22b01e9f932e0a5ee47da8f0c3fb to your computer and use it in GitHub Desktop.
const UA = req.headers['user-agent'];
const isMobile = Boolean(UA.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment