Add setting value to enable/disable pdf.js
This commit is contained in:
parent
1882fb6006
commit
8b141037ef
@ -306,7 +306,8 @@ class BrowserPage(QWebPage):
|
||||
else:
|
||||
reply.finished.connect(functools.partial(
|
||||
self.display_content, reply, 'image/jpeg'))
|
||||
elif mimetype in {'application/pdf', 'application/x-pdf'}:
|
||||
elif (mimetype in {'application/pdf', 'application/x-pdf'} and
|
||||
config.get('content', 'enable-pdfjs')):
|
||||
# Use pdf.js to display the page
|
||||
html_page = _generate_pdfjs(reply)
|
||||
url = reply.url()
|
||||
|
@ -841,6 +841,11 @@ def data(readonly=False):
|
||||
"required to exactly match the requested domain.\n\n"
|
||||
"Local domains are always exempt from hostblocking."),
|
||||
|
||||
('enable-pdfjs', SettingValue(typ.Bool(), 'true'),
|
||||
"Enable pdf.js to view PDF files in the browser.\n\n"
|
||||
"Note that the files can still be downloaded by clicking"
|
||||
" the download button in the pdf.js viewer."),
|
||||
|
||||
readonly=readonly
|
||||
)),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user