In article <[EMAIL PROTECTED]>, Ulf Knoblich <[EMAIL PROTECTED]> 
wrote:

> I am working in an information extraction project and we need to
> retrieve the source code of a selection made by a 
> 
> user in his browser.
> Someone wrote a DLL for MSIE I think, but I don't know if a similar
> thing works for Netscape. I also tried the 
> 
> HotJava Component, which could be inserted as an applet, but it only
> supports HTML 3.2 and has some bugs. So I 
> 
> thought maybe we could use te Mozilla editor. Or is there a simpler way
> to do this?
> So, the user selects some text in a browser window, we want to get the
> start/end positions of this selection in the 
> 
> source code. And the solution should be as platform independent as
> possible. :) 

Try

window.editorShell.getContentsAs("text/html", 1);

See nsIEditorShell for the GetContentsAs method, and nsIDocumentEncoder
for the flags.

Simon

-- 
          Simon Fraser   Entomologist
  [EMAIL PROTECTED]   http://people.netscape.com/sfraser/

Reply via email to