Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF preview - content won't load #371

Open
itisafrickinhighlander opened this issue Feb 9, 2021 · 16 comments
Open

PDF preview - content won't load #371

itisafrickinhighlander opened this issue Feb 9, 2021 · 16 comments

Comments

@itisafrickinhighlander
Copy link

Opening PDF in the preview of ElectronMail will not load the content itself, only the header with a name of file, page identificator and download/close buttons. Preview of e.g. images works fine, so it looks like something specific to PDFs.

I can confirm FF or Chromium will show the content correctly, but both would use web version Beta35, so maybe a bug in Beta33?

@vladimiry
Copy link
Owner

vladimiry commented Feb 9, 2021

@electron has a known long-standing issue of displaying the PDF. I was subscribed to related issues and I've noticed they enabled some fixes. So if they fixed the issue then it will be respectively resolved in the next app release.

@vladimiry vladimiry added the bug label Feb 9, 2021
@vladimiry
Copy link
Owner

vladimiry commented Feb 9, 2021

The recent @electron 11.2.3 still affected. Going to test the case again during preparing new app release (hopefully this week).

@vladimiry
Copy link
Owner

The app reports net::ERR_BLOCKED_BY_CLIENT error for the following requests when I click on invoce viewing link (which triggers modal with PDF in it):

  • chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/main.js
  • chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer.js
  • chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.css

@vladimiry
Copy link
Owner

Updated @electron / 11.1.0 => 12.0.0-beta.25 prints different error in comparison to the error posted in the previous message:

{
  errorCode: -6,
  errorDescription: 'ERR_FILE_NOT_FOUND',
  validatedURL: 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html',
  isMainFrame: true
}

@Numline1
Copy link

Hi @vladimiry, were there any updates on this on Electron side? Thanks!

@vladimiry
Copy link
Owner

The pdf viewing issue in @electron I believe was resolved a long time ago. The app still doesn't show the pdf so some debugging is supposed to be performed which I'm not planning to work on in the near future.

@Numline1
Copy link

No problem, thank you anyway :)

@KaKi87
Copy link

KaKi87 commented Jan 28, 2022

Hello @vladimiry, I have no problem previewing PDFs using <embed> on electron@^11.3.0.

@vladimiry
Copy link
Owner

vladimiry commented Jan 28, 2022

@KaKi87 of course I've tried the very basic pure electron+pdf use case before and it worked. Apparently there are some specifics in the way @ProtonMail presents a pdf on the page. So my answer remains the same:

The app still doesn't show the pdf so some debugging is supposed to be performed which I'm not planning to work on in the near future.

@vladimiry
Copy link
Owner

vladimiry commented Jan 28, 2022

Ok, I've just tried to switch the app's webviews to a "persistent partition" mode and it worked (PDFs got displayed in the app). So it appears to be an upstream bug in @electron project.

The thing is that the app by design uses only in-memory partitions/sessions (a security/privacy matter), so switching to "persistent" ones is not going to happen. A possible workaround is patching the @ProtonMail code in order to make it use a custom pdf rendering (via PDF.js or similar stuff).

@ghost
Copy link

ghost commented Mar 6, 2023

I am experiencing this issue, on ElectronMail v5.1.5. Opening PDFs show a blank white screen -- top bar with filename, navigation, download, and close buttons are all visible. But not the PDF itself.

@javaduke
Copy link

Same issue here, v5.1.7.

@ghost
Copy link

ghost commented Aug 17, 2023

Are there any plans for fixing this issue? I'm on v5.1.8, and have several people using ElectronMail having to download all the PDFs we receive in order to view them.

@vladimiry
Copy link
Owner

The fix should land on the @electron side. Only workaround could happen here, there is no ETA though.

@itisafrickinhighlander
Copy link
Author

itisafrickinhighlander commented Feb 7, 2024

I'm not sure if I am reading this correctly, but it looks like the new PM desktop client uses ElectronMail
https://github.com/ProtonMail/inbox-desktop
and I have just recalled the PDF preview issue so I gave it a try and it worked. The upstream bug in Electron doesn't seem to be solved, though, so any idea if it can be caused by something else or it just can't be compared between EM and PM desktop client?

@vladimiry
Copy link
Owner

@itisafrickinhighlander if you read the previous comments, you will see that the issue only takes place if the in memory partition type is used for the webview. Apparently it's not the case for PM desktop app.

The webview is used for multiple accounts support. I don't know if PM desktop app has multiple accounts support at this time.

The in memory partition type is used in the app in order to keep all the data in app's control vs letting default browser's storages to be persisted (it's likely done this way in PM desktop client).

So it's wrong to directly compare PM and EM apps, since the functionality and data persisting model are different. If PM app is a better fit for your needs, so let it serve you. I'm not going to make webview's partitions persisted, as in my opinion it weakens the data security. So, as described before, the PDF displaying issue has to be resolved at the @electron side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants