ElectronMail
ElectronMail copied to clipboard
PDF preview - content won't load
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?
@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.
The recent @electron 11.2.3 still affected. Going to test the case again during preparing new app release (hopefully this week).
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
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
}
Hi @vladimiry, were there any updates on this on Electron side? Thanks!
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.
No problem, thank you anyway :)
Hello @vladimiry, I have no problem previewing PDFs using <embed>
on electron@^11.3.0
.
@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.
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).
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.
Same issue here, v5.1.7.
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.
The fix should land on the @electron side. Only workaround could happen here, there is no ETA though.
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?
@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.