Get users browser & os information (Uses userAgent)
npm install browser-agent- Chrome
- Edge
- Firefox
- IE
- Safari
- Windows
- Mac OS
- Ubuntu
- Fedora
- Red Hat
- Linux Mint
- CentOS
- Debian
- Linux
- Android
- iOS
- iPadOS
- Unix
---
``ts
import { detectMac } from 'browser-agent'
const shortcutToolTipLabel = (event: Keyboard) => {
const alt = ${detectMac(userAgent) ? '⌥' : 'alt'}${detectMac(userAgent) ? '⇧' : 'shift'}
const shift = ${alt} + ${shift} + T
return `
}
`cjs
const browserAgent = require('browser-agent')
const { detectMac } = browserAgent
const shortcutToolTipLabel = (event) => {
const alt = ${detectMac(userAgent) ? '⌥' : 'alt'}${detectMac(userAgent) ? '⇧' : 'shift'}
const shift = ${alt} + ${shift} + T
return `
}
The npm packages:
- browser-agentbrowser-agent-collection`
-
Have the same version to grantee compatibility with each other.
Before starting, please read our Code of Conduct and Contributing Guidelines for detailed information and instructions on contributing to this repository.