Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
react-render-in-browser
Advanced tools
A React component that helps you render browser specific content.
Ever wanted to put up a banner for all your IE users and ask them to try your site in Chrome/Firefox?
With RenderInBrowser component you can render content specific to browsers. 🎉
<RenderInBrowser ie only>
<div>All the magic tricks in this site work best in Chrome/Firefox!</div>
</RenderInBrowser>
$ npm install --save react-render-in-browser
import RenderInBrowser from 'react-render-in-browser';
const Example = () => {
return (
<div>
<RenderInBrowser ie only>
<div>Ugh, our super duper animation won't work in IE</div>
</RenderInBrowser>
<RenderInBrowser except firefox safari>
<div>Why don't you use Firefox or Safari?</div>
</RenderInBrowser>
<RenderInBrowser chrome firefox only>
<div>I like Chrome and Firefox</div>
</RenderInBrowser>
</div>
);
};
The div Ugh, our super duper animation won't work in IE
will be rendered only in IE.
The div Why don't you use Firefox or Safari?
will be rendered in all browsers except Firefox and Safari.
The div I like Chrome and Firefox
will be rendered only in Chrome or Firefox.
The following browsers are supported as prop types and they are case-sensitive.
Note that mobile
is a type of browser. Desktop chrome and mobile chrome are not the same although they share the same name. They are built independent of each other and what necessarily works in Desktop Chrome might not necessarily work in mobile Chrome. Most mobile browsers behave the same and identifying them apart is a bit tricky and thus we're grouping all mobile browsers into one.
The following conditions are supported as prop types and they are case-sensitive.
When only is used, the children will render only in browsers passed as props.
<RenderInBrowser ie edge only>
<div>Renderded only in IE and Edge</div>
</RenderInBrowser>
When except is used, the children will render in all browsers except those that are passed as props.
<RenderInBrowser except safari>
<div>Rendered in all except safari</div>
</RenderInBrowser>
MIT © Dinesh Pandiyan
FAQs
A React component to render browser specific content
The npm package react-render-in-browser receives a total of 1,132 weekly downloads. As such, react-render-in-browser popularity was classified as popular.
We found that react-render-in-browser 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 researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.