nextcloud / nextcloud/files_pdfviewer
Print preview not allways displayed in Firefox
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 108
- Forks
- 61
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 29
Description
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Nextcloud: 33.0.8
files_pdfviewer: 6.0.0
Browser: Firefox 155.0.1
Steps to reproduce
- Log in to Nextcloud.
- Open a PDF in Files.
- Click the printer icon in the PDF viewer toolbar.
- The print dialog opens, but the preview contains only the placeholder icon.
- Press Ctrl+F5.
- Open the print dialog again: the preview is rendered correctly.
- Open another PDF: its print preview is also rendered correctly.
- Reload the Nextcloud page normally using Ctrl+L, Enter.
- Open a PDF file and print it again: the preview isn’t working again, and neither is the printout.
Expected behaviour
It should be possible to view the PDF in the print preview and then print it.
Actual behaviour
In Firefox the print preview initially shows only a placeholder. A hard reload fixes the problem until the next normal page load.
Tried it on different machines.
Unfortunately, it’s not just the preview that’s not working. Only the placeholder icon is being printed. Currently, we’re telling our users that they need to press ‘Ctrl+F5’ so that they can at least print the document.
Additional observations:
- Same PDFs work correctly in Brave.
- Local PDFs opened directly in Firefox print correctly.
- Network requests triggered by clicking the printer icon return HTTP 200.
- No relevant JavaScript errors are reported after starting the viewer.
- CSP warnings occur both before and after Ctrl+F5 and therefore do not appear to be related.
- When opening the Files app, there is one error in the browser's log:
[ERROR] viewer: Could not register handler
Object { app: "viewer", uid: "j.kressdorf", level: 2, error: "The handler is already registered", handler: {…} }
[index.mjs:47:17](https://waldorf-mgl.ddns.net/apps/viewer/node_modules/@nextcloud/logger/dist/index.mjs)
log index.mjs:47
error index.mjs:65
registerHandler Viewer.js:89
beforeMount Viewer.vue:526
beforeMount Viewer.vue:525
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
Reproduce the failure in Firefox by comparing a normal page reload with Ctrl+F5, then inspect the handler-registration path in Viewer.js around line 89 and Viewer.vue around lines 525-526. Use the browser log entry as the starting clue and verify that PDF preview and printing work after a normal reload without requiring a hard refresh.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100