matrix-react-sdk
62ba7dde - Download PDFs as blobs to avoid empty grey screens

Commit
7 years ago
Download PDFs as blobs to avoid empty grey screens Fixes https://github.com/vector-im/riot-web/issues/8605 The grey screen of sadness comes up when Chrome tries to open the PDF but doesn't have the right CSP headers. To avoid this, we'll just force a download of the PDF through `fetch` and `Blob`. There are a few cases where the user might still get a grey screen though: namely if they open the URL in a new tab or when the event content is lying about the file type, or the file is too large to blobify. `fetch` works in Chrome, Firefox, and our packaged Electron version.
Author
Parents
Loading