Выберите текст
const getSelectedText = () => window.getSelection().toString();
Tired Tortoise
const getSelectedText = () => window.getSelection().toString();