How to modify / add to context menu within selection?

I would like to have a special URL in my FF context menu so that when I select some text and right click on it, I can have an option to add that text into a specific URL, as in https://somesite.com/?MySelectedText and go to that URL… but I cannot seem to figure out how to do this. Is this possible?

Yes, it is possible. Take a look at LEO Dictionaries to see how it’s done…

Yeah, you can do it using the window.getSelection() function from a content script. I’ve done something similar in my add-on. I did some messaging to the background script, but I don’t think that’s necessary. To be honest, it’s been so long, I can’t remember off the top of my head why I did it that way anyway.