You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm using Firefox 37 x86_64 on Fedora 22 and Rangy 1.3 beta (rev 133c7c6).
highlighter.serialize and removeAllHighlights work as expected even with <iframe> elements, while highlight.highlighSelection doesn't (nothing seems to happen).
The problem is caused by the fact that highlightSelection (and other functions) calls api.getSelection() instead of api.getSelection(this.doc). I think that if an highlighter is created on a custom document, this document should be used as default selection.
Workaround (example):
var customSelection = rangy.getSelection(highlighter.doc)};
highlighter.highlightSelection(style, {selection:customSelection});
highlighter.unhighlightSelection(customSelection)
/* etc. */
frafra
changed the title
highlighter.highlightSelection doesn't work with <iframe> elements
highlighter doesn't use highlighter.doc as default selection when specified
May 1, 2015
Hi,
I'm using Firefox 37 x86_64 on Fedora 22 and Rangy 1.3 beta (rev 133c7c6).
highlighter.serialize and removeAllHighlights work as expected even with
<iframe>
elements, while highlight.highlighSelection doesn't (nothing seems to happen).Demo (live): https://about.frafra.eu/rangy-iframe-highlighter-bug/
Demo (code): https://github.com/frafra/rangy-iframe-highlighter-bug
The text was updated successfully, but these errors were encountered: