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

ember-useragent

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-useragent

An Ember addon for Fastboot-enabled userAgent parsing via UAParser.js.

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.8K
increased by3.26%
Maintainers
1
Weekly downloads
 
Created
Source

Ember UserAgent Download count all time npm

Ember UserAgent is an Ember Addon for UserAgent parsing via UAParser.js.

The userAgent service works in both browser & Fastboot environments and makes it easy to detect:

  • Device Type
  • Device Model
  • Browser
  • Operating System
  • Layout Engine
  • CPU architecture

Installation

ember install ember-useragent

Requirements

Ember CLI >=2.9.0

The shim for UAParser.js uses app.import's new AMD transformation feature released in Ember CLI 2.9.0.

Usage

Ember UserAgent exposes a service, which is automatically injected into controllers, components and routes.

const userAgent = this.get('userAgent');

userAgent.get('browser.isChrome'); // Boolean
userAgent.get('engine.isWebKit'); // Boolean
userAgent.get('os.info'); // => { name: 'Ubuntu', version: '11.10' }
userAgent.getDevice(); // => { model: 'iPhone 7', type: 'mobile', vendor: 'Apple'}

Service Properties

The service exposes all of UAParser's functions, but also adds some properties for quick access.

browserdeviceengineosuserAgent
infoinfoinfoinfo
isChromeisConsoleisWebKitisAndroid
isFirefoxisDesktopisIOS
isIEisMobileisLinux
isSafariisTabletisMacOS
isWindows

Injection

By default, this addon will generate an initializer in app/initializers/user-agent.js that injects the userAgent service app-wide. If the userAgent property conflicts with other addons or you wish to use manual injection (Ember.service.inject) you can override this file.

Using UAParser.js

For more information on how to use UAParser.js, please refer to the documentation.

Keywords

FAQs

Package last updated on 25 Apr 2017

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