Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
custom-device-detect
Advanced tools
custom-device-detect is a user agent parser. custom-device-detect will pars your custom user agent and detect your device.
custom-device-detect is a user agent parser.
custom-device-detect parse your custom user agent and detect your device.
npm i custom-device-detect
const deviceDetect = require("custom-device-detect");
const userAgent =
"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1";
const parsedUserAgent = deviceDetect(userAgent);
console.log(parsedUserAgent);
// result:
/* {
isDesktop: false,
isMobile: true,
isBot: false,
isCustomDevice: false,
}*/
Example - custom user agent detection:
const deviceDetect = require("custom-device-detect");
const userAgent = "osmanaga's phone";
const myCustomUserAgent = "osmanaga's phone";
const parsedUserAgent = deviceDetect(userAgent, myCustomUserAgent);
console.log(parsedUserAgent);
// result:
/* {
isDesktop: false,
isMobile: false,
isBot: false,
isCustomDevice: true,
}*/
Google bots sometimes can be mobile or desktop.
Example - user agent bot detection:
const deviceDetect = require("custom-device-detect");
// if user agent is a mobile bot
const userAgent =
"Mozilla/5.0 (Linux; Android 5.0; SM-G920A) AppleWebKit (KHTML, like Gecko) Chrome Mobile Safari (compatible; AdsBot-Google-Mobile; +http://www.google.com/mobile/adsbot.html)";
const parsedUserAgent = deviceDetect(userAgent);
console.log(parsedUserAgent);
// result:
/* {
isDesktop: false,
isMobile: true,
isBot: true,
isCustomDevice: false,
}*/
FAQs
custom-device-detect is a user agent parser. custom-device-detect will pars your custom user agent and detect your device.
The npm package custom-device-detect receives a total of 30 weekly downloads. As such, custom-device-detect popularity was classified as not popular.
We found that custom-device-detect 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.