I want to retrieve the xpath of the currently selected text in a browser. Using JavaScript I am able to get the selected text, but was not able to get the xpath.
I can find the xpath manually using Firebug, but I want to do it programatically. Is it possible to do it?
[EDIT] Okay, found a pointer to the solution in this thread. Modified the code from that thread to fit my needs.