
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
node-selection
Advanced tools
Get current selected text by using system accessibility APIs
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.process
: Object
| <undefined>
pid
: <number>
| <undefined>
The process ID.name
: <string>
| <undefined>
The filename of the process.bundleIdentifier
: <string>
| <undefined>
The bundle identifier of the process (macOS only).import { getSelection } from 'node-selection';
try {
const { text, process } = await getSelection();
console.log('current selection:', { text, process });
} 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 0 weekly downloads. As such, node-selection popularity was classified as not 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.