Qutebrowser: pdfjs: download button non-functional

Created on 8 Oct 2018  路  3Comments  路  Source: qutebrowser/qutebrowser

First of all, thanks for this beautiful feature!

Version info (see :version): 1.5.0
qutebrowser v1.5.0
Git commit: (installed with pip3)
Backend: QtWebEngine (Chromium 61.0.3163.140)

CPython: 3.6.5
Qt: 5.9.4
PyQt: 5.10.1

sip: 4.19.7
colorama: no
pypeg2: 2.15
jinja2: 2.10
pygments: 2.2.0
yaml: 3.13
cssutils: 1.0.2 $Id$
attr: 18.2.0
PyQt5.QtWebEngineWidgets: yes
PyQt5.QtWebKitWidgets: yes
pdf.js: 1.9.426 ($HOME/.local/share/qutebrowser/pdfjs/build/pdf.js) installed manually
sqlite: 3.23.1
QtNetwork SSL: OpenSSL 1.1.0h-fips 27 Mar 2018

Style: QFusionStyle
Platform: Linux-4.12.14-lp150.12.16-default-x86_64-with-glibc2.3.4, 64bit
Linux distribution: openSUSE Leap 15.0 (unknown)
Frozen: False
Imported from $HOME/.local/lib/python3.6/site-packages/qutebrowser
Using Python from /usr/bin/python3
Qt library executable path: /usr/lib64/qt5/libexec, data path: /usr/share/qt5
OS Version:

--- /etc/os-release ---
NAME="openSUSE Leap"
VERSION="15.0"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.0"
PRETTY_NAME="openSUSE Leap 15.0"
CPE_NAME="cpe:/o:opensuse:leap:15.0"

Does the bug happen if you start with --temp-basedir? (if applicable): yes

Description
The download button provided by pdfjs does not work. However, all other buttons (printing etc.) do work as expected.

How to reproduce

  • install pdfjs
  • :set content.pdfjs true
  • open some pdf file
  • nothing happens

The debug output related to the button event:

08:27:01 DEBUG    webview    webenginetab:_js_cb_single:609 Got element from JS: {'attributes': {'class': 'toolbarButton download hiddenMediumView', 'data-l10n-id': 'download', 'id': 'download', 'tabindex': '34', 'title': 'Download'}, 'class_name': 'toolbarButton download hiddenMediumView', 'id': 0, 'outer_xml': '<button id="download" class="toolbarButton download hiddenMediumView" title="Download" tabindex="34" data-l10n-id="download">\n                  <span data-l10n-id="download_label">Download</span>\n                </button>', 'rects': [{'bottom': 28, 'height': 25, 'left': 1809, 'right': 1841, 'top': 3, 'width': 32}], 'tag_name': 'BUTTON', 'text': '\n                  Download\n                ', 'value': ''}
08:27:01 DEBUG    webelem    webelem:is_editable:261 Checking if element is editable: <qutebrowser.browser.webengine.webengineelem.WebEngineElement html='<button id="download" class="toolbarButton download hiddenMediumView" title="Download" tabindex="34" data-l10n-id="download"><span data-l10n-id="download_label">Download</span></button>'>
08:27:01 DEBUG    mouse      mouse:_mousepress_insertmode_cb:190 Clicked non-editable element!
08:27:01 DEBUG    modes      modeman:leave:307 Ignoring leave request for KeyMode.insert (reason click) as we're in mode KeyMode.normal

A nice (and maybe more qutebrowser-stylish) workaround would be to hide the download-button at all and add the right functionity/behaviour to :download?

Most helpful comment

FWIW this does indeed work fine with Qt 5.12 now.

All 3 comments

For the moment I do :download-open to open in the system pdf viewer and use the 'save-as' dialog from there.

Edit: though, printing to file is a better workaround..

There's unfortunately not much qutebrowser can do about this - it happens because of two upstream bugs:

Neither of both look like they'll be changed anytime soon :wink: However, with Qt 5.12 and #4198, this should work in the future.

A nice (and maybe more qutebrowser-stylish) workaround would be to hide the download-button at all and add the right functionity/behaviour to :download?

Not sure if I want to hide it, as this issue only happens with specific Qt/PDF.js version combinations. Agreed on making :download work with PDF.js, see #4262.

FWIW this does indeed work fine with Qt 5.12 now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nagy135 picture nagy135  路  3Comments

mhep picture mhep  路  3Comments

The-Compiler picture The-Compiler  路  4Comments

The-Compiler picture The-Compiler  路  3Comments

ghost picture ghost  路  3Comments