mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Explicitly disable plugins when rendering HTML for covers. According to the Qt docs they should be disabled by default, but https://bugs.launchpad.net/bugs/1270297 implies they are not.
This commit is contained in:
parent
83ac6bd846
commit
31a94acf5b
@ -138,6 +138,8 @@ def render_html(path_to_html, width=590, height=750, as_xhtml=True):
|
|||||||
path_to_html = os.path.abspath(path_to_html)
|
path_to_html = os.path.abspath(path_to_html)
|
||||||
with CurrentDir(os.path.dirname(path_to_html)):
|
with CurrentDir(os.path.dirname(path_to_html)):
|
||||||
page = QWebPage()
|
page = QWebPage()
|
||||||
|
settings = page.settings()
|
||||||
|
settings.setAttribute(settings.PluginsEnabled, False)
|
||||||
pal = page.palette()
|
pal = page.palette()
|
||||||
pal.setBrush(QPalette.Background, Qt.white)
|
pal.setBrush(QPalette.Background, Qt.white)
|
||||||
page.setPalette(pal)
|
page.setPalette(pal)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user