On Fri, Mar 6, 2009 at 1:01 PM, Ilya S. Lebedev <ilya@xxxxxxxxxxx> wrote: > Hello, Massimiliano > > All you need to do is store the selection coordinates on the dialog > open, then restore them on action. > > The easiest way to handle this is using my DocumentSelection library: > > http://svn.debugger.ru/repos/jslibs/BrowserExtensions/trunk/documentselection.js > It successfully tracks all the oddities of the Internet Explorer. > > If you'd like to extract only the selection calculation code, search > for the "-100000000" substring and take the whole function from there. > I'd use your library but I have a problem with it (I don't know where I'm wrong or so). A little test is here http://maxb.net/scripts/dokuwiki/caret/test.html if you want to look at it. thanks in advance Max