zlwu dd667101ef first commit 1 rok temu
..
example dd667101ef first commit 1 rok temu
.npmignore dd667101ef first commit 1 rok temu
README.md dd667101ef first commit 1 rok temu
index.js dd667101ef first commit 1 rok temu
package.json dd667101ef first commit 1 rok temu

README.md

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