nextcloud / nextcloud/files_pdfviewer
PDF Viewer in Nextcloud 25 not working with QtWebEngine 5.15 LTS (Chromium 87 based) - please use PDF.js legacy build
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 108
- Forks
- 61
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 29
Description
Steps to reproduce
- Open up-to-date versions of Falkon and Qt 5 QtWebEngine.
- Log into Nextcloud. That works fine.
- Try to view a PDF. That does not. It worked in Nextcloud 24.
Expected behaviour
The PDF is displayed.
Actual behaviour
Blank space is displayed instead of the PDF viewer, and I get errors in the JavaScript console.
Additional information
The issue is that the PDF.js version was upgraded from 2.13.216 to 2.15.349, which introduces new JavaScript constructs not supported in Chromium 87, and that you use the default build of PDF.js, which supports only the very latest browsers, instead of the legacy build, which is much more compatible (see https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support). QtWebEngine 5.15 LTS is a stable branch with backported security fixes (comparable to the Firefox ESR branches).
I was able to quickly work around the issue by downgrading PDF.js to 2.13.216 on the server I administer, but I think using the legacy build would be a better long-term fix. I have not tried that yet, because I am not sure what exactly I need to change. (pdfjs-dist ships both the default and the legacy build, the latter in a subdirectory.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating where pdfjs-dist is imported or bundled in the PDF viewer, then compare the available default and legacy build paths described in the issue. Verify the change by opening a PDF in Falkon with QtWebEngine 5.15 and confirm that the viewer renders instead of showing blank space and JavaScript errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100