AngularJS service that gives you a collection of methods for knowing more about your client browser
JavaScript HTML
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
src
test
.gitignore
.jshintrc
.npmignore
.travis.yml
LICENSE
README.md
bower.json
index.html
index.js
karma.conf.js
package.json

README.md

ngBrowserInfo

Build Status

ngBrowserInfo is an AngularJS service that gives you a collection of methods for knowing more about your client browser:

  • Browser name and version
  • OS name and version
  • Are cookies enabled
  • Is user using a mobile device
  • Language
  • Screen size
  • Window size

Installation

npm install ng-browser-info

or

bower install ng-browser-info

Usage

// Add ngBrowserInfo as a dependency to your app
angular.module('your-app', ['ngBrowserInfo']);

// Inject browserInfo service into your controller
angular.module('your-app').controller('MainCtrl', function($scope, browserInfo) {
  // ...
});

Methods

// Returns object with width and height properties
browserInfo.getScreenSize();
browserInfo.getWindowSize();

// Returns Boolean
browserInfo.isMobile();
browserInfo.areCookiesEnabled();

// Returns String
browserInfo.getLanguage();

// Returns object with name and version properties
browserInfo.getOSInfo();
browserInfo.getBrowserInfo();

// giveMeAllYouGot() collects all the method results into one object
browserInfo.giveMeAllYouGot();

Demo

Check it out here

License

Apache 2.0 License