files_pdfviewer icon indicating copy to clipboard operation
files_pdfviewer copied to clipboard

Safari PDF preview not loading

Open FesTGig opened this issue 3 years ago • 1 comments

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)

FesTGig avatar Oct 29 '22 20:10 FesTGig

As I wrote in #684, the issue appears to be that the Nextcloud PDF viewer is using the default build of PDF.js instead of the legacy build, but only the latter supports the browsers Nextcloud itself supports.

kkofler avatar Nov 22 '22 04:11 kkofler