[Project_owners] How to get selected text

Jaap A. Haitsma jaap at haitsma.org
Sat Mar 13 15:30:38 EST 2004


I'm trying to obtain the text that is selected. If text is selected in a 
web page (in Firefox) or in a message (in Thunderbird) I can obtain the 
text very easily by calling gContextMenu.searchSelected(). However if 
the selected text is inside a <textarea> or <input> tag (Firefox) or in 
the message composer (Thunderbird) I don't manage to get the selected text.

I've been looking in the mozilla cross reference 
http://lxr.mozilla.org/mozilla/ for quite a while to try to figure out 
how the command copy works (because that is available at the points I 
want to get the selection), but sofar I'm still not able to get it 
working. :(


More information about the Project_owners mailing list