Question

I have been doing some hours of research and trial and error on this topic but can't seem to find a decent documentation or suggestions on how to get me started in the right direction.

What I am trying to achieve is create my own Firefox add-on which is supposed to let you select text on any given website, right click and display a context menu option to send the selection to a given website.

Does someone have any experience with any of those issues or is able to come up with something from the top of your head?

Much appreciated.

Was it helpful?

Solution

How do I write a Firefox Addon? gives you some places to get started.

For what you're doing specifically, you'll want to use an overlay to add an item to the right-click menu, which has id="contentAreaContextMenu". See https://developer.mozilla.org/en/DOM/selection for information on getting the text the user selected (if they didn't select anything then you probably don't need your menu item to show up at all) and then just do something like gBrowser.addTab('myurl.com?q=' + encodeURIComponent(selectedText));

OTHER TIPS

One of the best ways to get started is follow this tutorial:

http://www.borngeek.com/firefox/toolbar-tutorial/

Then find other extensions similar to yours and unzip them and check out the code.

I suggest checking out: addons.mozilla.org/en-US/firefox/addon/8703/

Hope that helps you get started.

Chris

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top