news:pKudnVTop7FPoOnN...@mozilla.org...
Hi Neil,
I have a bit of an issue yet. I am selecting all of the text in the document
and creating a range. However when we get the text it contains CSS and
SCRIPT nodes. I am interested in strictly the readable text....something
like doing a ctrl+a followed by a ctrl+c.
Here is my code. Is there a way to select the readable/viewable text only?
var contentDoc = gBrowser.selectedBrowser.contentDocument;
contentDoc.getSelection().selectAllChildren(contentDoc);
var win = gBrowser.getBrowserForDocument(contentDoc).contentWindow;
var selObj = win.getSelection();
var range = selObj.getRangeAt(0);
var docText = range.toString();
I am thinking that I will have to iterate through the selection and remove
nodes like STYLE and SCRIPT.
I also looked at copy the selection to the clipboard, but I could not find a
method that would copy the current user selected text.
Any thoughts?
Thanks,
Tom