Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@smartbear/browser-info

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smartbear/browser-info

Tiny developer-friendly JS library that provides information about host browser

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
137
decreased by-46.69%
Maintainers
0
Weekly downloads
 
Created
Source

Browser Info

GitHub Workflow Status Current Release License: ISC

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

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.

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 file for details.

Keywords

FAQs

Package last updated on 08 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc