toggle-selection

Toggle current selected content in browser

MIT 9 个版本
安装
npm install toggle-selection
yarn add toggle-selection
pnpm add toggle-selection
bun add toggle-selection
README

Toggle Selection

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.

Example

example recording

版本列表
2.1.0 2026-04-25
2.0.0 2026-04-06
1.0.6 2017-07-24
1.0.5 2016-07-26
1.0.4 2015-10-10
1.0.3 2015-09-02
1.0.2 2015-09-02
1.0.1 2015-09-02
1.0.0 2015-09-02