Retrieve selected text in GeckoWebBrowser

Christian LeMoussel <[email protected]> Mon, 2 Jun 2014 22:29:49 -0700 (PDT)
Newsgroups gmane.comp.mozilla.devel.embedding
Message-ID <[email protected]>
Hi,


I'm using GeckoFX with C#.NET. Some text in the page can be selected. This text is composed of one or more DOM elements. I want to retrieve the selected text in the page.

geckoWebBrowser.Window.Selection is an accessor for a GeckoSelection object which contains some informations such as

    AnchorOffset: offset within the (text) node where the selection begins,

    FocusOffset: offset within the (text) node where the selection ends.

I can't find how to get all the nodes & offset where selection starts and ends, or how can I can get a range of all elements spanned by the selection.

How can I do this?



Thanks

Christian.