Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
A small, lightweight and composable browser detection utility heavily inspired by bowser
.
Install it using your favourite package manager:
$ npm install bowser-jr
# or
$ yarn add bowser-jr
# or
$ pnpm add bowser-jr
Now just import getParser
and the parsers
you need:
import { getParser } from 'bowser-jr';
import { getBrowserName, browserParser } from 'bowser-jr/browser';
const parser = getParser(window.navigator.userAgent, { use: [browserParser] });
console.log(getBrowserName(parser)); // outputs `Firefox`
You can use multiple parsers to extract more information from the user agent:
import { getParser } from 'bowser-jr';
import { browserParser } from 'bowser-jr/browser';
import { engineParser } from 'bowser-jr/engine';
import { osParser } from 'bowser-jr/os';
import { platformParser } from 'bowser-jr/platform';
const parser = getParser(window.navigator.userAgent, {
use: [browserParser, engineParser, osParser, platformParser],
});
console.log(parser.getResult());
bowser-jr
also comes with a compatibility utility for bowser
to make adoption a little easier:
import BowserCompat from 'bowser-jr/compat';
const browser = BowserCompat.getParser(window.navigator.userAgent);
console.log(browser.getBrowser());
// outputs
{
name: "Internet Explorer"
version: "11.0"
}
FAQs
Light-weight, composable browser detector
The npm package bowser-jr receives a total of 200 weekly downloads. As such, bowser-jr popularity was classified as not popular.
We found that bowser-jr 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
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.