Commit 0aa26e7c authored by Laurent Montel's avatar Laurent Montel 😁

Try to clear selection

parent b308c195
......@@ -192,8 +192,22 @@ QString WebEngineScript::scrollToRelativePosition(int pos)
QString WebEngineScript::clearSelection()
{
const QString source = QString::fromLatin1("if(\"document.selection\") {"
" document.selection.clear ();"
"};");
#if 0
if (window.getSelection) {
if (window.getSelection().empty) { // Chrome
window.getSelection().empty();
} else if (window.getSelection().removeAllRanges) { // Firefox
window.getSelection().removeAllRanges();
}
}
#endif
const QString source = QString::fromLatin1("(function() {"
"if (window.getSelection) {"
" if (window.getSelection().empty) {"
" window.getSelection().empty();"
" }"
"}"
"})()");
qDebug()<<" source "<<source;
return source;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment