0

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.

  1. User selects text on page
  2. User right-clicks selection and left-clicks extension from context menu
  3. Selected text is accessed by extension and set as var
  4. var is printed

Step 3 is what I'm stuck on.

How can I do this?

karhu
  • 119
  • 1
  • 9
  • 1
    Possible duplicate of [Get Selection DOM in chrome extension contextmenu](http://stackoverflow.com/questions/28211174/get-selection-dom-in-chrome-extension-contextmenu) – wOxxOm Nov 27 '15 at 09:41
  • Use google to see more examples: [stackoverflow chrome extension get selected text in context menu](https://www.google.com/#q=stackoverflow+chrome+extension+get+selected+text+in+context+menu) – wOxxOm Nov 27 '15 at 09:41

0 Answers0