Bug 52281
| Summary: | No way to get the source code of the selection only | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Julien Dumont <julien_dumont> |
| Component: | WebKit Misc. | Assignee: | Nobody <webkit-unassigned> |
| Status: | UNCONFIRMED | ||
| Severity: | Normal | CC: | ap, christian.stromme, julien_dumont |
| Priority: | P3 | ||
| Version: | 420+ | ||
| Hardware: | All | ||
| OS: | All | ||
Julien Dumont
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
Will this work for you?
1. Get Range from DOMSelection - window.getSelection().getRangeAt(0).
2. Call Range.extract.
3. Serialize the extracted range.