nextcloud / files_pdfviewer

:book: A PDF viewer for Nextcloud
GNU Affero General Public License v3.0
88 stars 44 forks source link

Safari PDF preview not loading #674

Open FesTGig opened 1 year ago

FesTGig commented 1 year ago

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)
kkofler commented 1 year ago

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.