0

I understand how to use window.getSelection().toString() to get the user's selection in a 'regular' (plain vanilla) website via a Chrome Extension and a content script.

Is it possible to achieve the same goal in more complex websites? Like a Google Doc, PDF preview (via Chrome browser), or other embedded/iframed/complex renderers?

Appreciations for any suggestions/direction.

11teenth
  • 1,853
  • 1
  • 15
  • 28
  • It is possible but you'll need to investigate this for each site individually and possibly reverse-engineer the page scripts, there is no universal solution. For PDF viewer, see [How can I get selected text in pdf in Javascript?](https://stackoverflow.com/a/61076939) – wOxxOm Jun 14 '20 at 13:46
  • Many thanks, as always! Was kind of afraid of that answer but makes sense. – 11teenth Jun 14 '20 at 21:26

0 Answers0