Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
ember-useragent
Advanced tools
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:
ember install ember-useragent
Fastboot
Should you be using Fastboot in your application, Ember UserAgent >=0.2.0 requires Ember CLI Fastboot >=1.0.0.
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.get('device.info'); // => { model: 'iPhone 7', type: 'mobile', vendor: 'Apple'}
The service exposes all of UAParser's functions, but also adds some properties for quick access.
browser | device | engine | os | cpu |
---|---|---|---|---|
info | info | info | info | architecture |
isChrome | isConsole | isWebKit | isAndroid | |
isChromeHeadless | isDesktop | isIOS | ||
isEdge | isMobile | isLinux | ||
isFirefox | isTablet | isMacOS | ||
isIE | isWindows | |||
isSafari | isWindows |
The service also exposes the userAgent
property, which contains the user agent string.
You can overwrite this property, if you want to force a certain user agent string.
All of the properties described above will update in accordance.
There aren't many use cases for using it manually, but Ember UserAgent shims UAParser.js into your application. You can import it like any other module:
import UAParser from 'ua-parser-js';
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.
For more information on how to use UAParser.js, please refer to the documentation.
FAQs
An Ember addon for Fastboot-enabled userAgent parsing via UAParser.js.
The npm package ember-useragent receives a total of 3,692 weekly downloads. As such, ember-useragent popularity was classified as popular.
We found that ember-useragent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.