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

Exported chats have broken avatars due to inclusion of crossorigin="anonymous", this <img> attribute should be removed in exports #26491

Closed
ctrlcctrlv opened this issue Nov 1, 2023 · 1 comment · Fixed by matrix-org/matrix-react-sdk#12537
Labels
A-Export-Chat O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect X-Regression Z-Compound

Comments

@ctrlcctrlv
Copy link

Steps to reproduce

  1. Where are you starting? What can you see?

I export chats, avatars are broken despite existing in users/ dir in zip.

Outcome

What did you expect?

Avatars to not be broken.

What happened instead?

Broken avatars. Console reads:

Access to image at 'file:///tmp/Element%20-%20[SNIP]%20-%20Chat%20Export%20-%202023-11-01T21-10-56.369Z/users/@copypaste-matrix.mfek.org.png' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
Access to image at 'file:///tmp/img/e2e/normal.33e0430.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.

Operating system

Arch GNU/Linux

Application version

Element version: 1.11.45 Olm version: 3.2.14

How did you install the app?

pacman package element-desktop

Homeserver

matrix.mfek.org runs Synapse version №1.88.0-1

Will you send logs?

Yes

@andybalaam andybalaam added S-Minor Impairs non-critical functionality or suitable workarounds exist O-Occasional Affects or can be seen by some users regularly or most users rarely A-Export-Chat labels Nov 2, 2023
@t3chguy
Copy link
Member

t3chguy commented Jan 9, 2024

This is blocked on element-hq/compound#293

Regressed by matrix-org/matrix-react-sdk#11448

robintown added a commit to element-hq/compound-web that referenced this issue May 14, 2024
By omitting the crossOrigin attribute, we change avatars to use a non-CORS request to fetch the image. This allows avatars to load even on null origins (fixing element-hq/element-web#26491), but also prevents us from inspecting the image data in JavaScript, for example by using it in a canvas. We weren't doing that of course, so switching to the locked-down non-CORS mode should have no consequences.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Export-Chat O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect X-Regression Z-Compound
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants