question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Description:

  • A-Frame Version: 0.9.1
  • Platform / Device: Chrome/74.0.3

I am facing a situation, where I do not want to add Origin: www.domain.com to request header while getting an image using a-sky and a-image.

For example, in my case -

<!-- is working -->
<img src="image_source">

<!-- CORS error -->
<img src="image_source" crossorigin="anonymous">

I tried with below solutions I found but none of them worked.

  1. Try to remove crossOrigin from ImageLoader
if (window.THREE)  {
  window.THREE.ImageLoader.prototype.crossOrigin = ''
}
  1. Try to set crossOrigin via FileLoader
if (window.THREE)  {
  window.THREE.FileLoader.prototype.setRequestHeader('crossOrigin', '')
}
  1. Use a-assets to load image
<script src="https://aframe.io/releases/0.9.1/aframe.min.js"></script>

<a-scene>
    <a-assets>
        <img id="sky" src=image_source">
    </a-assets>
    <a-sky src="#sky"></a-sky>
</a-scene>

Is there any way to prevent aframe to adding crossOrigin=“anonymous” in header?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sanjay-bhuvacommented, May 1, 2019

Updated @dmarcos . I will create a demo and with the reproducable example soon.

0reactions
dmarcoscommented, Jun 10, 2019

@jlavie The server that hosts the images has to be CORS configured. Look for Cloudfront CORS configuration. Closing this since I don’t think there’s nothing actionable on A-Frame side. We can reopen if necessary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CORS errors - HTTP - MDN Web Docs - Mozilla
If the CORS configuration isn't setup correctly, the browser console will present an error like "Cross-Origin Request Blocked: The Same ...
Read more >
3 Ways to Fix the CORS Error — and How the Access-Control ...
Fix one: install the Allow-Control-Allow-Origin plugin. The quickest fix you can make is to install the moesif CORS extension .
Read more >
What Is a CORS Error and How to Fix It (3 Ways) - Bannerbear
As a CORS error occurs when the external API server doesn't return the HTTP headers required by the CORS standard, you can add...
Read more >
CORS errors and how to solve them - Topcoder
CORS is an abbreviation for Cross-Origin Response Sharing. ... Or, your API fails and shows a CORS error in the console.
Read more >
A Guide to Solving Those Mystifying CORS Issues
An 'issue with CORS' occurs when the API does not reply to such request with, 'Yes, dear browser, you are allowed to do...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found