Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/SmartBear/browser-info
Tiny developer-friendly JS library that provides information about host browser
https://github.com/SmartBear/browser-info
bitbar browser-info on-prem saas user-agent user-agent-parser
Last synced: 3 months ago
JSON representation
Tiny developer-friendly JS library that provides information about host browser
- Host: GitHub
- URL: https://github.com/SmartBear/browser-info
- Owner: SmartBear
- License: isc
- Created: 2020-09-09T10:46:48.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-06T01:59:17.000Z (about 1 year ago)
- Last Synced: 2024-07-21T19:24:00.186Z (4 months ago)
- Topics: bitbar, browser-info, on-prem, saas, user-agent, user-agent-parser
- Language: JavaScript
- Homepage:
- Size: 290 KB
- Stars: 1
- Watchers: 11
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Browser Info
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/SmartBear/browser-info/Test?label=lint%20%2B%20test)
[![Current Release](https://img.shields.io/github/release/SmartBear/browser-info.svg)](releases)
[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](LICENSE.md)Tiny (~2KB) vanilla JS developers-friendly library that provides information about host browser and OS.
A goal of this library **isn't** creation of the all-knowing and heavy database. Rather focus is to keep is small and light.
Eg if you want to focus on major browsers and platforms.Demo: https://smartbear.github.io/browser-info/
## Supported Browsers and OS
### Browsers
- ✔️ Chrome
- ✔️ Firefox
- ✔️ Edge
- ✔️ Opera
- ✔️ SamsungInternet
- ✔️ UCBrowser
- ✔️ Safari
- ✔️ InternetExplorer### OS
- ✔️ Windows
- ✔️ Windows Phone
- ✔️ MacOS
- ✔️ iOS
- ✔️ iPadOS
- ✔️ ChromeOS
- ✔️ Android
- ✔️ BlackBerry
- ✔️ webOS
- ✔️ Linux## Usage
```js
import BrowserInfo from '@smartbear/browser-info'BrowserInfo.detect(); // if param not given, then it will use navigator.userAgent
console.log(BrowserInfo.name); // print detected browser's name
console.log(BrowserInfo.release); // print detected browser's major release number
console.log(BrowserInfo.version); // print detected browser's version string
console.log(BrowserInfo.os); // print detected OS name
```### Auto Detect and Embed
In `dist` directory there is a file with `.embed` sufix. Importing this library into your UI will cause calling
`detect()` method and assigning `BrowserInfo` to `window.navigator.browserInfo` - this way it is accessible globally.```js
import '@smartbear/browser-info/dist/smartbear-browser-info.embed.min'console.log(window.navigator.browserInfo);
```## License
This project is licensed under the ISC License - see the [LICENSE](LICENSE) file for details.