
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
node-selection
Advanced tools
Get current selected text by using system accessibility APIs
npm i node-selection
macOS requires accessibility permissions to be granted before a program can control the Mac by using accessibility features.
checkAccessibilityPermissions([options])
options
: <Object>
prompt
: <boolean>
Default: false
Returns: <Promise>
Fullfills upon success with a boolean indicating
whether accessibility permissions have been granted to this program.
If prompt
is true
, a prompt window will be shown when accessibility
permissions have not been granted.
If this method is invoked on non-macOS platform, it always returns true
.
import { checkAccessibilityPermissions } from 'node-selection';
if (!(await checkAccessibilityPermissions({ prompt: true }))) {
console.log('grant accessibility permissions and restart this program');
process.exit(1);
}
getSelection()
Returns: <Promise>
Fullfills upon success with an object with one property:
text
: <string>
| <undefined>
Current selected text.import { getSelection } from 'node-selection';
try {
const { text } = await getSelection();
console.log('current selection:', text);
} catch (error) {
// no valid selection
console.error('error', error);
}
FAQs
Get current selected text by using system accessibility APIs
The npm package node-selection receives a total of 1,355 weekly downloads. As such, node-selection popularity was classified as popular.
We found that node-selection 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
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.