0

I am developing an extension where I need to use window or document.getSelection() inside one of my content script.

I use React and I created a popup where I use lexical. In order to lexical to work properly I have to get the selection within my popup. So I don't need the selection in the webpage itself.

I tried to get the selection via scripting, but I hope there is a better way to get the selection inside my own component

Rohit Gupta
  • 4,022
  • 20
  • 31
  • 41
Wicat21
  • 11
  • 3
  • A more performant alternative to chrome.scripting in case you need to get the selection many times in the same tab is `chrome` [messaging](https://developer.chrome.com/extensions/messaging), but you'll still need to inject the content script the first time. – wOxxOm Mar 13 '23 at 14:21

0 Answers0