https://github.com/daun/modernizr-useragents
Simple user-agent checks for Modernizr
https://github.com/daun/modernizr-useragents
js modernizr useragent
Last synced: about 1 year ago
JSON representation
Simple user-agent checks for Modernizr
- Host: GitHub
- URL: https://github.com/daun/modernizr-useragents
- Owner: daun
- License: mit
- Created: 2020-06-24T15:10:52.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-24T15:15:56.000Z (almost 6 years ago)
- Last Synced: 2025-05-20T06:43:35.377Z (about 1 year ago)
- Topics: js, modernizr, useragent
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Modernizr User-Agent Tests
Add simple user-agent checks as Modernizr tests.
> :warning: The checks in this package are meant for light-weight corrections to browser engines' rendering quirks. They are too simple and unreliable for critical feature checks.
## Installation
```bash
npm install modernizr-useragents
```
## Usage
### Add specific tests
```js
import addUserAgentTests from 'modernizr-useragents'
addUserAgentTests(['firefox', 'safari'])
```
### Add all available tests
```js
import { addAllUserAgentTests } from 'modernizr-useragents'
addAllUserAgentTests()
```
## Tests
The following tests are available:
| Name | Test |
| --------- | ------------------------------------------ |
| `ms` | Microsoft browsers: IE & pre-chromium Edge |
| `ipad` | Safari on iPadOS |
| `iphone` | Safari on iOS |
| `ipod` | Safari on iPods' iOS |
| `ios` | Either `ipad`, `iphone` or `ipod` |
| `safari` | Safari, desktop or phone |
| `firefox` | Firefox |
## License
[MIT License](https://opensource.org/licenses/MIT) © [Philipp Daun](https://philippdaun.net/)