Getting selected text with CKEditor Plugin on IE

ckeditor, internet-explorer, javascript, plugins

Solution

This is what I use:

var mySelection = editor.getSelection();

if (CKEDITOR.env.ie) {
    mySelection.unlock(true);
    selectedText = mySelection.getNative().createRange().text;
} else {
    selectedText = mySelection.getNative();
}

Problem

I have made a plugin for CKEditor, but it relies on the currently selected text. In FF and Chrome I can use: ``` var selectedText = editor.getSelection().getNative(); ``` but this doesn't work in IE and I only get `[object Object]` Any suggestions?

Original source