unoplatform/uno

[WASM] Use `crossorigin="anonymous"` if web image fails to load

Open

#10.645 aberto em 5 de dez. de 2022

Ver no GitHub
 (5 comments) (1 reaction) (0 assignees)C# (837 forks)batch import
difficulty/starter 🚀good first issuekind/bugno-reproplatform/wasm 🌐project/media 📺

Métricas do repositório

Stars
 (9.789 stars)
Métricas de merge de PR
 (Mesclagem média 14d 8h) (130 fundiu PRs em 30d)

Description

Current behavior

Currently when Image source is a HTTPS URL, it will fail to load in case crossorigin attribute is not set to anonymous due to Cross-Origin-Embedder-Policy header.

<StackPanel Padding="40">
        <Image Width="50" Height="50" Source="https://i.postimg.cc/rpRG3S21/screenshot-195.png"></Image>
        <BitmapIcon Height="50" Width="50" UriSource="https://img.icons8.com/material/96/000000/positive-dynamic--v1.png"/>
</StackPanel>

Expected behavior

If the image fails to load due to CORS, we should retry with crossorigin = anonymous added. This is now needed since the Cross-Origin-Embedder-Policy header is used to enable threading

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

No response

Works on UWP/WinUI

Yes

Environment

No response

NuGet package version(s)

No response

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

Guia do colaborador