nextcloud / nextcloud/files_pdfviewer

Safari PDF preview not loading

Open
#674 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
JavaScript
Stars
108
Forks
61
Avg merge
2d 9h
Merged PRs (30d)
29

Description

Steps to reproduce
  1. open pdf in Safari
Expected behaviour

Tell us what should happen

Actual behaviour

Tell us what happens instead
The PDF preview is not working in Safari. On Firefox and Chrome its working perfectly.

Server configuration

Operating system:
Debian 11
Web server:
nginx 1.18
Database:
MariaDB
PHP version:
8.1
Nextcloud version: (see Nextcloud admin page)
24.0.6
Where did you install Nextcloud from:

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or

Insert your config.php content here
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)
Client configuration

Browser:
Safari 14.1.2
Operating system:
MacOS 10.14.6

Logs
Nextcloud log (data/owncloud.log)
Insert your Nextcloud log here
Browser log
[Error] Unrecognized Content-Security-Policy directive 'worker-src'.
[Error] SyntaxError: Unexpected private name #ensureObj. Cannot parse class method with private name.
	(anonymous function) (pdf.js:3170)
[Error] SyntaxError: Unexpected private name #onMouseDown. Cannot parse class method with private name.
	(anonymous function) (viewer.js:4062)
[Error] ReferenceError: Can't find variable: PDFViewerApplicationOptions
	(anonymous function) (files_pdfviewer-workersrc.js:2:110080)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the PDF preview in Safari 14.1.2 and inspect the browser errors in pdf.js, viewer.js, and files_pdfviewer-workersrc.js. The issue is done when PDFs load in Safari without the reported parsing and PDFViewerApplicationOptions errors, while Firefox and Chrome continue to work.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.