I want to access user-selected text from a context menu in a Chrome extension.
In case my explanation isn't clear, here's the basic use-case.
- User selects text on page
- User right-clicks selection and left-clicks extension from context menu
- Selected text is accessed by extension and set as
var
var
is printed
Step 3 is what I'm stuck on.
How can I do this?