Set disableCreateObjectURL for PDF.js

We can't use blob URLs or we'll get a renderer crash:
https://bugreports.qt.io/browse/QTBUG-70420

Thankfully, we can tell PDF.js to use data: URLs instead.
This commit is contained in:
Florian Bruhin 2018-09-06 19:40:43 +02:00
parent bbcb87e434
commit c40ddf37b7

View File

@ -69,6 +69,7 @@ def _generate_pdfjs_script(url):
"""
return (
'document.addEventListener("DOMContentLoaded", function() {{\n'
' PDFJS.disableCreateObjectURL = true;\n'
' PDFJS.verbosity = PDFJS.VERBOSITY_LEVELS.info;\n'
' (window.PDFView || window.PDFViewerApplication).open("{url}");\n'
'}});\n'