views:

104

answers:

1

Hello,

When writning very simple and basic extension for firefox, what event (I don't know if this is the right word) should I use if I want to process user selected text?

To be more precise: when user selects some text (for example when ALT is pressed), I want to pass this text to function, grab some data from the web (based on selected text) and display results in small balloon like popup window.

+1  A: 

See here for getting the current selection: http://www.codetoad.com/javascript_get_selected_text.asp

This document describes how to notice that the user might have selected something: http://www.java2s.com/Code/JavaScript/HTML/CapturingaTextSelection.htm

Aaron Digulla