0.3.1 • Published 1 year ago

@wig12/browser-detection v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Michael-Wigham's Browser Detection

npm version

JavaScript library for detecting browsers and platforms using feature testing.

  • Accurate: it doesn't rely on the User-Agent string like other libraries [1] [2].

  • Solid: it's tested against a large dataset of Browser Object Model (BOM).

Getting started

To add Paguro's Browser Detection library to your project:

$ npm add @wig12/browser-detection

Usage

import BrowserDetection from '@wig12/browser-detection'; // ES6

const detectedBrowser = BrowserDetection();
console.log(detectedBrowser);

/* -- Output
  {
     browser: 'Firefox',
     browserVersion: 67,
     layout: 'Gecko',
     layoutVersion: 67,
     os: 'Windows',
     osVersion: 95
  }
*/

Detection

Browsers

BrowserDetectable versions
Internet Explorer11
Edge44 / 80 & 120
Chrome40 / 80 & 120
Chromium40 / 80
Firefox42 / 74 & 117 / 120
Safari8 / 13
Opera66
Brave1.3

Layout engines

BrowserLatest version
Trident-
EdgeHTML-
Gecko-
WebKit-
Blink-
KHTML-
Presto-

Operating systems

BrowserLatest version
OS X-
Windows-
Linux-
Unix-
Solaris-
iOS-
Android-

Known bugs and issues

  • The fields layoutVersion and osVersion are not populated yet

Future Features

  • Support for mobile browsers
    • Chrome Android
    • Firefox for Android
    • Opera Android
    • Safari on iOS
    • Samsung Internet
    • WebView Android
  • Populate the field layoutVersion
  • Populate the field osVersion
  • Sandbox to prevent feature spoofing

Authors

See also the list of contributors who participated in this project.

License

Paguro's Browser Detection is MIT licensed.

0.3.1

1 year ago

0.3.0

2 years ago