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

fix: Origin error when using Image() constructor #469

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

wouterlucas
Copy link
Contributor

This fixes the error:
net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 302 (Found)

This fixes the error:
net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 302 (Found)
@@ -134,6 +134,7 @@ export class ImageTexture extends Texture {

async loadImageFallback(src: string, hasAlpha: boolean) {
const img = new Image();
img.crossOrigin = 'anonymous';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Lightning 2 do it as well, but has some custom logic do NOT do it for Playstation.
Maybe don't autodetect the platform, but ImageTexture could have a static flag which could be externally disabled to not do set this crossOrigin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS4 is currently set to go the ION route if all goes well - so skipping this until it pops up as an issue again.

src/core/textures/ImageTexture.ts Outdated Show resolved Hide resolved
@wouterlucas wouterlucas merged commit 7b9353f into main Dec 11, 2024
1 of 2 checks passed
@wouterlucas wouterlucas deleted the fix/cors-error-new-image branch January 10, 2025 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants