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.
@thang2162/react-native-user-agent
Advanced tools
Library that helps you to get mobile application user agent and web view user agent strings.
yarn add @thang2162/react-native-user-agent
or, for npm use
npm install @thang2162/react-native-user-agent --save
2.1 react-native >= 0.60
Autolinking will take care of the link step, but for iOS, don't forget to run pod install
in ios/
folder
If you haven't set up cocoapods yet, please refer to that article
2.2 react-native < 0.60
You have to call link
command manually:
react-native link @thang2162/react-native-user-agent
For manual linking, please refer to:
import UserAgent from '@thang2162/react-native-user-agent';
UserAgent.getUserAgent(); //synchronous
UserAgent.getWebViewUserAgent() //asynchronous
.then(ua => {})
.catch(e => {})
System | User-Agent | WebView User-Agent |
---|---|---|
iOS | application-name/1.6.4.176 CFNetwork/897.15 Darwin/17.5.0 (iPhone/6s iOS/11.3) | Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E217 |
Android | application-name/1.6.7.42 Dalvik/2.1.0 (Linux; U; Android 5.1.1; Android SDK built for x86 Build/LMY48X) | Mozilla/5.0 (Linux; Android 5.1.1; Android SDK built for x86 Build/LMY48X) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Mobile Safari/537.36 |
Additionally module returns a set of constants, that are used in user agent string building.
For iOS:
For Android:
Breaking History:
getWebViewUserAgent()
returns promiseMIT. Copyright (c) 2020 Tone T. Thangsongcharoen
FAQs
Library that helps you to get mobile application user agent and web view user agent strings.
The npm package @thang2162/react-native-user-agent receives a total of 0 weekly downloads. As such, @thang2162/react-native-user-agent popularity was classified as not popular.
We found that @thang2162/react-native-user-agent 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.