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.
scroll-zoom-clamp
Advanced tools
This DOM utility prevents zooming components from hijacking mouse-wheel events and interfering with the natural scroll of a page.
By wrapping a child element with this component, wheel events are only propagated downstream if a modifier key is pressed (ctrl or meta key - ⌘, ⊞), otherwise a message is overlayed informing the user to do so by pressing the key.
import ScrollZoomClamp from 'scroll-zoom-clamp';
or using a script tag
<script src="//unpkg.com/scroll-zoom-clamp"></script>
then
// assuming a parentNode and a childNode element
parentNode.appendChild(
new ScrollZoomClamp(childNode).node
);
new ScrollZoomClamp(childNode, { configOptions })
Creates a new scroll zoom protection, wrapped around the childNode
element.
The following configuration options are available:
Config option | Description |
---|---|
message: str | Ability to customize the message shown when the zoom is blocked. Supports plain text or HTML content. |
Type | Attribute | Description |
---|---|---|
Getter | node | Returns the wrapper DOM element. |
If this project has helped you and you'd like to contribute back, you can always buy me a ☕!
FAQs
Prevent page scrolling interference by zooming components
We found that scroll-zoom-clamp 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.