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

THREE.XHRLoader Data URI handling for Safari (OS X and iOS) #9823

Merged
merged 1 commit into from
Oct 7, 2016

Conversation

richtr
Copy link
Contributor

@richtr richtr commented Oct 5, 2016

Safari is unable to fetch Data URIs via XMLHttpRequest. The following code throws an error:

var loader = new THREE.XHRLoader();
loader.load("data:,hello");

// works in Chrome and Firefox

// throws in Safari with: "XMLHttpRequest cannot load data:,hello. Cross origin requests are only supported for HTTP."

This PR detects whether the input URL is a Data URI and, if it is, then it will be manually processed in to the requested .responseType type, if any is provided. The default response format is String.

…an not load Data URIs through XMLHttpRequest
This was referenced Oct 5, 2016
@mrdoob mrdoob merged commit 18a33bd into mrdoob:dev Oct 7, 2016
@mrdoob
Copy link
Owner

mrdoob commented Oct 7, 2016

Thanks!

aardgoose pushed a commit to aardgoose/three.js that referenced this pull request Oct 7, 2016
aardgoose pushed a commit to aardgoose/three.js that referenced this pull request Oct 7, 2016
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.

2 participants