Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- document.addEventListener('mouseup', selectedText);
- function selectedText(event) {
- var selected = window.getSelection().toString();
- if (selected.length > 0) {
- chrome.runtime.sendMessage({ "word": selected });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement