Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
ua-device-detector
Advanced tools
Parses user-agent to set css classes or directly usable via JS / NodeJS.
#ua-device-detector
$ bower i ua-device-detector -S
var uaDeviceDetector=require('ua-device-detector');
.
.
.
var deviceInfo=uaDeviceDetector.parseUserAgent(options);
Add script load to HTML:
<script type="text/javascript" src=".../re-tree.js"></script>
<script type="text/javascript" src=".../ua-device-detector.js"></script>
Then use in your javascript:
var deviceInfo = window.uaDeviceDetector.parseUserAgent(options);
To use from angular:
Don't - Instead use ng-device-detector :)
Usage with Webpack
:
An issue with webpack might cause an error like this:
- Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
To solve add this to your webpack.config.js
:
module.exports = {
module: {
unknownContextCritical: false
}
};
More details here
parseUserAgent options specification:
navigator.platform
navigator.maxTouchPoints
parseUserAgent returns a deviceInfo object:
Pull-requests with new stuff will be highly appreciated :)
Please remember to add tests when making changes.
1.1.8 (2019-12-12)
<a name="1.1.7"></a>
FAQs
Parses user-agent to set css classes or directly usable via JS / NodeJS.
The npm package ua-device-detector receives a total of 3,241 weekly downloads. As such, ua-device-detector popularity was classified as popular.
We found that ua-device-detector 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.