Obtenha o texto selecionado

const getSelectedText = () => window.getSelection().toString();
Tired Tortoise