https://github.com/github/browser-detection
A utility for detecting browsers in Braintree libs.
https://github.com/github/browser-detection
Last synced: 5 months ago
JSON representation
A utility for detecting browsers in Braintree libs.
- Host: GitHub
- URL: https://github.com/github/browser-detection
- Owner: github
- License: mit
- Archived: true
- Fork: true (braintree/browser-detection)
- Created: 2017-08-31T10:20:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-31T13:54:01.000Z (over 8 years ago)
- Last Synced: 2024-09-25T21:09:52.400Z (over 1 year ago)
- Language: JavaScript
- Size: 31.3 KB
- Stars: 17
- Watchers: 2
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Browser Detection
=================
A utility for detecting browser support for Braintree libs.
## Example
```js
var browserDetection = require('browser-detection');
browserDetection.isAndroid();
browserDetection.isChrome();
browserDetection.isEdge();
browserDetection.isIe();
browserDetection.isIe9();
browserDetection.isIe10();
browserDetection.isIe11();
browserDetection.isIos();
browserDetection.isIosFirefox();
browserDetection.isIosSafari();
browserDetection.isIosWebview();
browserDetection.isIosUIWebView();
browserDetection.isIosWKWebView();
browserDetection.isMobileFirefox();
browserDetection.isSamsungBrowser();
browserDetection.supportsPopups();
```
To reduce build sizes, you can require just the modules you need:
```js
var isAndroid = require('browser-detection/is-android');
var isChrome = require('browser-detection/is-chrome');
var isEdge = require('browser-detection/is-edge');
var isIe = require('browser-detection/is-ie');
var isIe9 = require('browser-detection/is-ie9');
var isIe10 = require('browser-detection/is-ie10');
var isIe11 = require('browser-detection/is-ie11');
var isIos = require('browser-detection/is-ios');
var isIosFirefox = require('browser-detection/is-ios-firefox');
var isIosSafari = require('browser-detection/is-ios-safari');
var isIosWebview = require('browser-detection/is-ios-webview');
var isIosUIWebview = require('browser-detection/is-ios-uiwebview');
var isIosWKWebview = require('browser-detection/is-ios-wkwebview');
var isMobileFirefox = require('browser-detection/is-mobile-firefox');
var isSamsungBrowser = require('browser-detection/is-samsung');
var supportsPopups = require('browser-detection/supports-popups');
```
## Testing
```sh
npm test
```