TILs, snippets—my digital code garden 🌱. By Zander Martineau
All tags All notes javascript (47) css (33) react (32) html (13) typescript (9) testing (8) node (4) cli (4) graphql (4) devops (4) git (4) cheatsheet (4) storybook (2) typography (2) networking (1) animation (1) services (1) api (1) a11y (1) deno (1) cypress (1) vscode (1) 11ty (1) untagged (15)
© 2023 • Made by Zander • Colophon • RSS

📱 is-mobile check

Link https://github.com/faisalman/ua-parser-js
Note date 21 Jan, 2023
Tags javascript
const parser = require('ua-parser-js')

function isUserAgentSignallingMobile(userAgentString) {
const ua = parser(userAgentString)
return ua.device.type === 'mobile'
}

← Back home