Yet another library to determine the browser by useragent
From npm:
npm install browser-please --save
Or download build/parseBrowser.min.js
.
From npm:
import parseBrowser from "browser-please";
const browser = parseBrowser();
If you choise builded version, parseBrowser
available as global function.
browser = parseBrowser([ua])
ua (optional): user agent string. By default — user agent from current browser.
browser: object with parsed info, where:
- browser.name: name of browser or empty string if not detect;
- browser.version.major: major version of browser or zero if not detect;
- browser.version.minor: major and minor version of browser or zero if not detect;
- browser.version.full: full version of browser or zero if not detect;
- browser.platform: name of browser or empty string if not detect;
- Explorer
- Edge
- ExplorerMobile
- Firefox
- Chrome
- Safari
- Opera
- iOS
- OperaMini
- Android
- BlackBerry
- ChromeAndroid
- FirefoxAndroid
- OperaMobile
- UCAndroid
- Samsung
- win
- mac
- linux
- android
- iphone
- ipad
- ipod
- winphone
- blackberry
The most important question. These are browsers that are used, for example, in browserslist and caniuse.
You can open issue, and I'll add the answer to it here.
Available here.