Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
affixing-header
Advanced tools
An affixing header that behaves normally as a user navigates down a page, but reveals itself naturally when a user scrolls or drags upwards. Inspired by iOS Safari, Medium, and others.
Create an affixing header that behaves normally as a user navigates down a page, but reveals itself naturally when a user scrolls or drags upwards. Inspired by iOS Safari, Medium, and others. See an example implementation to see what it’s about. Works on desktop and mobile browsers.
The module is ESM-only and exports a single default affixingHeader
function:
affixingHeader( element )
element
HTMLElementThe DOM element to which the affixing behavior should be attached. Must be a single HTMLElement
(e.g., the result of document.querySelector
or document.getElementById
), not a NodeList
.
affixingHeader
function (element: HTMLElement) => () => void
The affixingHeader
function returns a cleanup function that takes no arguments and is used to remove listeners and cleanup the affixing behavior.
This package uses onscrolling, a requestAnimationFrame-based, performant, mobile-friendly scroll event handler, to listen for page scrolls, but has no other dependencies.
The scroll handling uses requestAnimationFrame
, which is only available in IE10+. To add full support for older browsers, just include a requestAnimationFrame polyfill.
FAQs
An affixing header that behaves normally as a user navigates down a page, but reveals itself naturally when a user scrolls or drags upwards. Inspired by iOS Safari, Medium, and others.
The npm package affixing-header receives a total of 51 weekly downloads. As such, affixing-header popularity was classified as not popular.
We found that affixing-header demonstrated a healthy version release cadence and project activity because the last version was released less than 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.