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.
toggle-selection
Advanced tools
The toggle-selection npm package is designed to enable and disable text selection on web pages. It provides a simple API to programmatically control the user's ability to select text within the document, which can be useful in various user interface scenarios where text selection might interfere with other interactions or where it needs to be controlled for security or aesthetic reasons.
Disable text selection
This feature allows developers to disable text selection on the entire web page. It is useful in scenarios where text selection could interfere with drag-and-drop interactions or other UI elements.
const toggleSelection = require('toggle-selection');
function disableSelection() {
toggleSelection.disable();
}
Enable text selection
This feature allows developers to re-enable text selection if it has been previously disabled. This is useful for toggling text selection dynamically based on certain user actions or application states.
const toggleSelection = require('toggle-selection');
function enableSelection() {
toggleSelection.enable();
}
Simple module exposing function that deselects current browser selection and returns function that restores selection.
var deselect = require('toggle-selection');
var reselect = deselect(); // remove all selection
// …
// do something with current selection, text, etc;
// …
reselect(); // restore selection
All credits go to @shvaikalesh.
FAQs
Toggle current selected content in browser
We found that toggle-selection 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.