
Security News
gem.coop Tests Dependency Cooldowns as Package Ecosystems Move to Slow Down Attacks
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.
useragent2css
Advanced tools

Parse an HTTP User-Agent header string and get a bunch of CSS classes back identifying the browser and OS of the client. That's it. Nothing more.
Why determine this on the server instead of on the client using javascript?
Because the javascript code will run after the browser has already started rendering the HTML code. By having the appropriate CSS classes injected in the HTML source as early as possible, the browser will render faster and slow browsers will not 'flicker'.
If you use Rails, add this to your Gemfile:
gem 'useragent2css'
In your view code, e.g.:
<body class="<%= useragent2css %>">
Example result:
<body class="webkit chrome chrome16 mac">
Or:
gem install useragent2css
And in your view code, e.g.:
<body class="<%= UserAgent.css(request["HTTP_USER_AGENT"]) %>">
Rafael Lima - for the original javascript implementation.
LATimes - for the original ruby implementation.
Lawrence Pit, lawrence.pit@gmail.com, lawrencepit.com, @lawrencepit
Copyright (c) 2012 Lawrence Pit. See MIT-LICENSE for details.
FAQs
Unknown package
We found that useragent2css 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
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.

Security News
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.