Initial PDF.js support for QtWebEngine
This commit is contained in:
parent
cb0c313404
commit
a0b4f09f02
@ -27,7 +27,7 @@ import functools
|
|||||||
from PyQt5.QtCore import pyqtSlot, Qt
|
from PyQt5.QtCore import pyqtSlot, Qt
|
||||||
from PyQt5.QtWebEngineWidgets import QWebEngineDownloadItem
|
from PyQt5.QtWebEngineWidgets import QWebEngineDownloadItem
|
||||||
|
|
||||||
from qutebrowser.browser import downloads
|
from qutebrowser.browser import downloads, pdfjs
|
||||||
from qutebrowser.utils import debug, usertypes, message, log, qtutils
|
from qutebrowser.utils import debug, usertypes, message, log, qtutils
|
||||||
|
|
||||||
|
|
||||||
@ -221,6 +221,10 @@ class DownloadManager(downloads.AbstractDownloadManager):
|
|||||||
download.set_target(self._mhtml_target)
|
download.set_target(self._mhtml_target)
|
||||||
self._mhtml_target = None
|
self._mhtml_target = None
|
||||||
return
|
return
|
||||||
|
if pdfjs.should_use_pdfjs(qt_item.mimeType()):
|
||||||
|
download.set_target(downloads.PDFJSDownloadTarget())
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
filename = downloads.immediate_download_path()
|
filename = downloads.immediate_download_path()
|
||||||
if filename is not None:
|
if filename is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user