Would be possible to modify this code some how to take this into account?
Code:
if (window.getSelection){
selection=window.getSelection();
}
else if (document.getSelection){
selection=document.getSelection();
}
else if (document.selection){