browser-detection

0.3.3 • Public • Published

browser-detection Build Status

Lightweight package to get information about browser, version and OS.

Installation

$ bower install browserdetection --save

Usage

Get Data

var data = browserDetection();
 
console.log(data.browser); // chrome
console.log(data.version); // 29
console.log(data.os); // osx

Add CSS classes to html tag

Javascript:

browserDetection({
    addClasses: true
});

CSS:

html{
    background: white;
}
 
/* Internet Explorer 7 specific */
html.ie-7{
    background: red;
}
 
/* Only for OSX users with firefox */
html.osx.firefox{
    background: blue;
}

Todo

  • More tests for...
  • osx
  • win
  • linux
  • mobile
  • Minification with grunt

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.3.3
    15
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.3.3
    15
  • 0.3.2
    0
  • 0.3.1
    0

Package Sidebar

Install

npm i browser-detection

Weekly Downloads

15

Version

0.3.3

License

none

Last publish

Collaborators

  • schickling