Brendan Posted March 5, 2015 Share Posted March 5, 2015 I'm trying to load an image url grabbed from the Facebook graph api for use in Phaser. (i want to use the players profile picture in game) I can get the url fine, when i try and apply the image to the sprite i get a cross origin error: Uncaught SecurityError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at xxxxxx may not be loaded I have had this working on an earlier version of phaser without a problem. Can anyone suggest what the issue may be? Link to comment Share on other sites More sharing options...
MikeT Posted March 5, 2015 Share Posted March 5, 2015 Maybe this can help:http://www.html5gamedevs.com/topic/7713-how-to-get-around-cors-in-phaser-when-all-assets-are-hosted-on-a-cdn/ Hmmm, I cannot tell you about the server because the guy is gone. But I am sure this solved it and it had nothing to do with the server (or atleast, we exhausted server options). //load the preloader stuffthis.load.crossOrigin = "Anonymous";this.load.image("background", "blah/background.png");OR If you are using chrome / canary for testing hit this extention to cancel out CORS. If that does not work, then for sure it has to do with the server.https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=enNote that I have no idea what any of it means, but our CORS issue is gone and that is good for me Link to comment Share on other sites More sharing options...
Brendan Posted March 5, 2015 Author Share Posted March 5, 2015 Thanks mike, this did help, i wasn't setting crossOrigin to "Anonymous". In a previous version of Phaser i didn't need to do this. cheers Link to comment Share on other sites More sharing options...
Recommended Posts