Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
angular-device-information
Advanced tools
To install this library, run:
$ npm install angular-device-detector --save
In your app.module.ts file add DeviceInformationDetectorService as providers
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { DeviceInformationDetectorService } from 'angular-device-detector';
@NgModule({
imports: [ BrowserModule, FormsModule ],
providers:[AngularDeviceInformationService],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
**In your component where you want to use the Device Service**
import { Component } from '@angular/core';
...
import { AngularDeviceInformationService } from 'angular-device-information';
...
@Component({
selector: 'home', // <home></home>
styleUrls: [ './home.component.scss' ],
templateUrl: './home.component.html',
...
})
export class HomeComponent {
deviceInfo = null;
...
constructor(private http: Http, private deviceInformationService: AngularDeviceInformationService) {
console.log(deviceInformationService.isMobile()); // returns if the device is a mobile device (android / iPhone / windows-phone etc)
console.log(deviceInformationService.isTablet()); // returns if the device us a tablet (iPad etc)
console.log(deviceInformationService.isDesktop()); // returns if the app is running on a Desktop browser.
console.log(deviceInformationService.getDeviceType()); // returns if the app is running on a Desktop browser.
console.log(deviceInformationService.getDeviceInfo().os); // returns os name
console.log(deviceInformationService.getDeviceInfo().osVersion); // returns os version
console.log(deviceInformationService.getDeviceInfo().browser); // returns browser name
console.log(deviceInformationService.getDeviceInfo().browserVersion); // returns browser version
console.log(deviceInformationService.getDeviceInfo().browserMajorVersion); // returns full browser version
console.log(deviceInformationService.getDeviceInfo().screen_resolution); // returns screnn size
console.log(deviceInformationService.getDeviceInfo().cookies); // returns cookies enabled or no
console.log(deviceInformationService.getDeviceInfo().userAgent); // returns userAgent
}
}
```
FAQs
<head> <meta name="google-site-verification" content="zApSXb8oh9SIBjqaVNlIs_IPT7sTwY4vwk59YS_CshE" /></head> angular device information
The npm package angular-device-information receives a total of 0 weekly downloads. As such, angular-device-information popularity was classified as not popular.
We found that angular-device-information 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.