- Code: Select all
const selection = window.getSelection();
const range = document.createRange();
range.selectNodeContents(node);
selection.removeAllRanges();
selection.addRange(range);
Another thing I noticed is that in CEF unittest text selection is accomplished by making two SendMouseClickEvent calls. When I try to do the same in my app it doesn't work. It starts working only after I make an additional SendMouseMoveEvent between these two clicks. However there is no mouse move event done in CEF unit tests, so I wonder why it works in CEF unit tests. CEF tests code here:
https://github.com/chromiumembedded/cef ... st.cc#L943
CEF 3359.