mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2033947 [Content Server returning error messages (Running from source*)](https://bugs.launchpad.net/calibre/+bug/2033947)
This commit is contained in:
parent
fef4b97a03
commit
9982065666
@ -242,7 +242,10 @@ def sandboxed_html(html, style, sandbox):
|
||||
final_html = f'<!DOCTYPE html><html><head><style>{css}</style></head><body>{html}</body></html>'
|
||||
# prevent context menu on right click in iframe
|
||||
ans.addEventListener('load', def(ev):
|
||||
try:
|
||||
ev.target.contentWindow.addEventListener('contextmenu', def(e): e.preventDefault();)
|
||||
except:
|
||||
pass
|
||||
)
|
||||
ans.srcdoc = final_html
|
||||
return ans
|
||||
|
Loading…
x
Reference in New Issue
Block a user