content script and context menus

121 views
Skip to first unread message

Hamza tanji cherkaoui

unread,
Aug 2, 2013, 8:45:46 AM8/2/13
to chromium-...@chromium.org
i want to know how to make a chrome extension ,that when the user right click on a text feild in a website , a context menu will apear , that context menu will have some storage variables , for example "name" or "email" , when the user click on "name" the value of the selected  field will be the name set to the value of variable that i stored .
i have managed to make the options and backround and the content script pages with the messaging and stuff , and i need some help with that context menu . thank you in advance

PhistucK

unread,
Aug 2, 2013, 8:52:57 AM8/2/13
to Hamza tanji cherkaoui, Chromium-extensions
You can use http://developer.chrome.com/extensions/contextMenus.html#method-create. Create as many context menu options as you want with it. Use the "editable" context and once a context menu option is selected, send a message to the content script with the value. The content script can query document.activeElement and replace its value accordingly.

Does that resolve your issue?


PhistucK


On Fri, Aug 2, 2013 at 3:45 PM, Hamza tanji cherkaoui <hoxa...@gmail.com> wrote:
i want to know how to make a chrome extension ,that when the user right click on a text feild in a website , a context menu will apear , that context menu will have some storage variables , for example "name" or "email" , when the user click on "name" the value of the selected  field will be the name set to the value of variable that i stored .
i have managed to make the options and backround and the content script pages with the messaging and stuff , and i need some help with that context menu . thank you in advance

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/837952c5-8888-43a0-a8d7-756c96195bf4%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages