E-book viewer: Fix copy to clipboard not ignoring text from elements that are marked as non user selectable. Fixes #1991504 [Copy text does not respect user-select: none](https://bugs.launchpad.net/calibre/+bug/1991504)

Apparently the bug in webengine where it does not copy HTML to the
clipbaord is no more, so we can go back to relying on the native copy
which does exclude such text automatically.
This commit is contained in:
Kovid Goyal 2022-10-09 15:25:42 +05:30
parent eebdd57a90
commit a1d2209fc7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -951,12 +951,11 @@ class IframeBoss:
select_crw(crw)
def copy_selection(self):
if not runtime.is_standalone_viewer:
try:
if document.execCommand('copy'):
return
except:
pass
try:
if document.execCommand('copy'):
return
except:
pass
s = window.getSelection()
text = s.toString()