UNCONFIRMED52281
No way to get the source code of the selection only
https://bugs.webkit.org/show_bug.cgi?id=52281
Summary No way to get the source code of the selection only
Julien Dumont
Reported 2011-01-12 01:45:30 PST
Hello, We use WebKit in our application to display some HTML/JavaScript content. We have a context menu, and we want that some actions available in the context menu depend on the selected part of the context. Maybe we missed something, but today, it seems unfortunately, there is no way to get neither the HTML source code, nor the DOM tree of the selection only.
Attachments
Alexey Proskuryakov
Comment 1 2011-01-12 16:38:17 PST
Will this work for you? 1. Get Range from DOMSelection - window.getSelection().getRangeAt(0). 2. Call Range.extract. 3. Serialize the extracted range.
Note You need to log in before you can comment on or make changes to this bug.