beaker icon indicating copy to clipboard operation
beaker copied to clipboard

PDF files not showing within the browser

Open johanbove opened this issue 5 years ago • 5 comments

Describe the bug PDF files are not showing properly within the browser.

To Reproduce Steps to reproduce the behavior:

  1. Go to a hyperdrive with PDF files
  2. Click on on a PDF file to open it in the browser
  3. The PDF seems to be opening
  4. But the file is not rendering. It seems stuck on a grey background with some icon in the middle.

Expected behavior The PDF file can be opened within the browser.

Screenshots Annotation 2020-05-28 001715

Annotation 2020-05-30 143530

Desktop (please complete the following information): Version: 1.0.0-prerelease.2

Electron: 9.0.0
Chromium: 83.0.4103.64
Node: 12.14.1
Hyperdrive: 10.11.0
API: 0
Daemon: 1.13.12
Client: 1.15.1
Schema: 1.10.0
Fuse Native:
Fuse:

Additional context Add any other context about the problem here.

johanbove avatar May 27 '20 22:05 johanbove

Thanks for filing, I'll look into it

pfrazee avatar May 28 '20 16:05 pfrazee

Not sure if this is related, but mp4 and mp3 files are also not loading up in the browser either. The browser seems to identify the mime-types, but then does not continue with downloading the binaries.

Annotation 2020-05-30 142939 Annotation 2020-05-30 143002 Annotation 2020-05-30 143948

johanbove avatar May 30 '20 12:05 johanbove

The video thing is a known issue, we've got an electron PR waiting

What I'm seeing right now is an error being emitted from Electron/Chromium's internals:

[51254:0603/111731.403067:INFO:CONSOLE(259)] "Refused to load plugin data from 'hyper://<redacted>/mozilla_builders_summer_startup_studio_response_CaAHdVHOD23B.pdf' because it violates the following Content Security Policy directive: "object-src * blob: externalfile: file: filesystem: data:".
", source: chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/controller.js (259)

That CSP is the pdf viewer extension's CSP so it looks like the * designation is not being properly applied to our custom protocol, hyper:. I'm going to need to work with upstream on this one.

pfrazee avatar Jun 03 '20 16:06 pfrazee

There is a temporary solution here: https://github.com/electron/electron/issues/24859

gscholer avatar Dec 28 '20 23:12 gscholer

Until this is fixed, is there a way to disable the PDF plugin so that links to PDFs either download the file and/or open it in an external PDF viewer?

rybesh avatar Mar 20 '21 15:03 rybesh