1

I'm learning how to write a Chrome extension and have implemented a simple plugin described at : http://developer.chrome.com/extensions/getstarted

The plugin I'm attempting to write needs to perform provide an option to perform based on text the user has highlighted within the page. Can point me in the direction of how to achieve this as I cannot seem to find documentation. So for example in below screen shot the selected text by user (the text is selected by using mouse to drag over text) is greyed out :

enter image description here

So if user right clicks on selected text an extra option is displayed which performs an action based on selected text. Can provide tutorials/or any points on how to implement this functionality ?

blue-sky
  • 51,962
  • 152
  • 427
  • 752

2 Answers2

0

Take a look at this answer for an example of how to get text selection back to your background page, https://stackoverflow.com/a/2645306/897414

Community
  • 1
  • 1
Bryan Clark
  • 2,542
  • 1
  • 15
  • 19
0

Here goes the related API you wanted: https://developer.chrome.com/extensions/contextMenus

nightire
  • 1,371
  • 2
  • 11
  • 21