From 31a94acf5b27ffc77d60964a947694dae655d878 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 20 Jan 2014 22:48:42 +0530 Subject: [PATCH] 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. --- src/calibre/ebooks/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/ebooks/__init__.py b/src/calibre/ebooks/__init__.py index 10b3b43b75..3d01f8484b 100644 --- a/src/calibre/ebooks/__init__.py +++ b/src/calibre/ebooks/__init__.py @@ -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) with CurrentDir(os.path.dirname(path_to_html)): page = QWebPage() + settings = page.settings() + settings.setAttribute(settings.PluginsEnabled, False) pal = page.palette() pal.setBrush(QPalette.Background, Qt.white) page.setPalette(pal)