Internet Explorer and Microsoft Edge browsers definition on JavaScript
Sometimes need to define only browsers from Microsoft. Other tools on JavaScript is bloated and slower. Because they seek to support most browsers.
- Pure, small (about 600 bytes gzip) and fast.
- Has no dependencies.
- Focused only on Microsoft browsers.
- Exports as UMD: Browser (global), AMD, CommonJS.
- Exports as ES Module.
- Has types for TypeScript.
$ yarn add low-browser
OR get it in https://unpkg.com/[email protected]/dist/
Function parses given user agent string and returns data object
Can be downloaded from https://unpkg.com/[email protected]/dist/low-browser.esm.min.js
import lowBrowser from './low-browser.esm.min.js'
//...
const {name, version} = lowBrowser('some user agent string')
if (name === 'IE' && version === '8.0') {
// do something
}
Can be downloaded from https://unpkg.com/[email protected]/dist/low-browser.umd.min.js
var data = lowBrowser('some user agent string')
if (data.name === 'IE' && data.version === '8.0') {
// do something
}
define('your-module', ['low-browser'], function (lowBrowser) {
var data = lowBrowser('some user agent string')
if (data.name === 'IE' && data.version === '8.0') {
// do something
}
})
const lowBrowser = require('low-browser')
//...
const {name, version} = lowBrowser('some user agent string')
if (name === 'IE' && version === '8.0') {
// do something
}
For TypeScript. Included in package. Can be downloaded from https://unpkg.com/[email protected]/dist/low-browser.d.ts
Returns data object after parsing given user agent string
Input user agent string
Type: string
Browser name
Type: string
May be Edge
, IE
, IEMobile
Browser version
Type: string
Example: 5.5b1
Browser core name
Type: string
May be EdgeHTML
or Trident
.
Browser core version
Type: string
Example: 4.0b1
Operating System
Type: string
Example: Windows NT 10.0
Operating System Build Number
Only for Microsoft Edge browser
Type: number
Example: 16299
Game Platform
Type: string
May be Xbox 360
or Xbox One
# Clone repository
$ git clone https://github.com/Arttse/low-browser.git && cd low-browser/
# Install all dependencies
$ yarn
# Run tests
$ yarn run test
MIT © 2015-2018 Nikita Bystrov (Arttse)