Server: Can't close PDF preview

Created on 19 May 2017  Â·  11Comments  Â·  Source: nextcloud/server

Steps to reproduce

1) Search for PDF
2) Click on PDF
3) If PDF did not open, click on it in the list
4) Click on close button

Server configuration

Nextcloud version: 12rc1

Logs

Uncaught ReferenceError: webpackJsonp is not defined
    at 0.editor.js:1
(anonymous) @ 0.editor.js:1
Error: Loading chunk 0 failed.
    at HTMLScriptElement.n (editor.js?v=f77ee4e…-45:1)
bug high regression

Most helpful comment

This might be of interest for the root cause analysis (tested with NC 12.0.3 and FF 55.0.3):

Opening and closing a pdf file is working, if

  1. your current folder contains a pdf file.
  2. you initiate a search for pdf files.
  3. you select a pdf files which exists in the current directory.
  4. If you click on such a pdf file it is opened instantly and also closed on request.

Opening and closing a pdf file doesn't work, if

  1. you initiate a search for pdf files.
  2. you select a pdf files which exists in an other directory than the current one.
  3. If you click on such a pdf file the opening routine navigates to the directory in which the pdf files was found - that's it. The pdf file isn't opened automatically.
  4. You have to click on the desired pdf file again to get it displayed on the screen. If you then want to close the file again, it doesn't work.

All 11 comments

Problem by the pdfviewer:

Warning: Deprecated API usage: PDFJS.openExternalLinksInNewWindow, please use "PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.  pdf.js:368:5
#Close is undefined.  l10n.js:829:7
#Close is undefined.  l10n.js:901:7
#close_label is undefined.  l10n.js:829:7
#close_label is undefined.  l10n.js:901:7
Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf self blockiert ("script-src 'nonce-UlZ6cjh2dGY4eUhmbHdFQ2s5dXc4R09XVTRkaUVsZEw2cm1zWlYzQ1c0QT06SHhLZXNZc1VoeE9KMlhoSC9KakN2QTNzQk1FMUtoc2ZwOENIVjJ1QkUrdz0='"). Source: call to eval() or related function blocked by CSP. (unbekannt)
PDF 588ee6e86a6f2bc3dd2844e4e88ca442 [1.5 IT Department Eurowings / pdfTeX-1.10b, LaTeX with hyperref] (PDF.js: 1.4.20)  viewer.js:6879:7   

cc @LukasReschke since its content security stuff

Problem persists in 12RC4...

nc v12.0.0 finish init, and login first,open nextcloud.mp4,can't close it.i use chrome

Bugger, I run NC12.0.0 on a staging server for two weeks and did not notice this one. Move to production and … 😢 😢

Oh, well. That's life. 😜

@9662
That's why i always wait for the next update befor upgrading my production :)
When this bug is fixed i will update from 11.03 to 12.02

fixed in current 12.0.1 RCx

Still not fixed when following the steps detailed in the OP.

This might be of interest for the root cause analysis (tested with NC 12.0.3 and FF 55.0.3):

Opening and closing a pdf file is working, if

  1. your current folder contains a pdf file.
  2. you initiate a search for pdf files.
  3. you select a pdf files which exists in the current directory.
  4. If you click on such a pdf file it is opened instantly and also closed on request.

Opening and closing a pdf file doesn't work, if

  1. you initiate a search for pdf files.
  2. you select a pdf files which exists in an other directory than the current one.
  3. If you click on such a pdf file the opening routine navigates to the directory in which the pdf files was found - that's it. The pdf file isn't opened automatically.
  4. You have to click on the desired pdf file again to get it displayed on the screen. If you then want to close the file again, it doesn't work.

Awesome job @j-ed

A possible fix for this issue is in https://github.com/nextcloud/files_pdfviewer/pull/49

Fixed and will be available in 12.0.5 and 13.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

blackcrack picture blackcrack  Â·  3Comments

mama21mama picture mama21mama  Â·  3Comments

arno01 picture arno01  Â·  3Comments

rullzer picture rullzer  Â·  3Comments

juliushaertl picture juliushaertl  Â·  3Comments