You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

node-selection

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-selection

Get current selected text by using system accessibility APIs

0.1.1
Source
npmnpm
Version published
Weekly downloads
17
-41.38%
Maintainers
1
Weekly downloads
 
Created
Source

node-selection

Get current selected text by using system accessibility APIs.

Prerequisite

  • Xcode (for macOS)
  • Visual Studio (for Windows)

Install

npm i node-selection

Usage

checkAccessibilityPermissions({ prompt = false }): Promise<boolean>

getSelection requires accessibility permissions to be granted. This function checks if accessibility permissions are granted.

If prompt is set to true, a prompt window that allows user open Accessibility panel will be shown.

On Windows, it always returns true.

getSelection(): Promise<{ text?: string }>

Get current selected text. An error will be thrown if this operation is failed or nothing is selected.

Example

See example/getSelection.js.

FAQs

Package last updated on 31 Mar 2022

Did you know?

Socket

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.

Install

Related posts